@@ -19,21 +19,21 @@ for T ∈ [Int64, Float64]
19
19
mutables = [rand (T,N), rand (MVector{N,T}), SizedVector {N} (rand (T,N))]
20
20
instances = vcat (immutables, mutables)
21
21
22
- namelengths = [length (string (typeof (v). name . name )) for v ∈ instances]
22
+ namelengths = [length (string (nameof ( typeof (v)) )) for v ∈ instances]
23
23
maxnamelength = maximum (namelengths)
24
24
25
25
for v ∈ instances
26
26
result = mean (@benchmark plus ($ (copy (v)), $ (copy (v))))
27
- padding = maxnamelength - length (string (typeof (v). name . name ))
28
- println (typeof (v). name . name , " :" , " " ^ padding, " v3 = v1 + v2 takes " , prettytime (time (result)), " , " , prettymemory (memory (result)), " (GC " , prettytime (gctime (result)) , " )" )
27
+ padding = maxnamelength - length (string (nameof ( typeof (v)) ))
28
+ println (nameof ( typeof (v)) , " :" , " " ^ padding, " v3 = v1 + v2 takes " , prettytime (time (result)), " , " , prettymemory (memory (result)), " (GC " , prettytime (gctime (result)) , " )" )
29
29
end
30
30
31
31
println ()
32
32
33
33
for v ∈ mutables
34
34
result = mean (@benchmark plus! ($ (copy (v)), $ (copy (v)), $ (copy (v))))
35
- padding = maxnamelength - length (string (typeof (v). name . name ))
36
- println (typeof (v). name . name , " :" , " " ^ padding, " v3 .= +.(v1, v2) takes " , prettytime (time (result)), " , " , prettymemory (memory (result)), " (GC " , prettytime (gctime (result)) , " )" )
35
+ padding = maxnamelength - length (string (nameof ( typeof (v)) ))
36
+ println (nameof ( typeof (v)) , " :" , " " ^ padding, " v3 .= +.(v1, v2) takes " , prettytime (time (result)), " , " , prettymemory (memory (result)), " (GC " , prettytime (gctime (result)) , " )" )
37
37
end
38
38
39
39
println ()
@@ -48,21 +48,21 @@ for T ∈ [Int64, Float64]
48
48
mutables = [rand (T,N,N), rand (MMatrix{N,N,T}), SizedMatrix {N,N} (rand (T,N,N))]
49
49
instances = vcat (immutables, mutables)
50
50
51
- namelengths = [length (string (typeof (v). name . name )) for v ∈ instances]
51
+ namelengths = [length (string (nameof ( typeof (v)) )) for v ∈ instances]
52
52
maxnamelength = maximum (namelengths)
53
53
54
54
for m ∈ instances
55
55
result = mean (@benchmark mul ($ (copy (m)), $ (copy (m))))
56
- padding = maxnamelength - length (string (typeof (m). name . name ))
57
- println (typeof (m). name . name , " :" , " " ^ padding, " m3 = m1 * m2 takes " , prettytime (time (result)), " , " , prettymemory (memory (result)), " (GC " , prettytime (gctime (result)) , " )" )
56
+ padding = maxnamelength - length (string (nameof ( typeof (m)) ))
57
+ println (nameof ( typeof (m)) , " :" , " " ^ padding, " m3 = m1 * m2 takes " , prettytime (time (result)), " , " , prettymemory (memory (result)), " (GC " , prettytime (gctime (result)) , " )" )
58
58
end
59
59
60
60
println ()
61
61
62
62
for m ∈ mutables
63
63
result = mean (@benchmark mul! ($ (copy (m)), $ (copy (m)), $ (copy (m))))
64
- padding = maxnamelength - length (string (typeof (m). name . name ))
65
- println (typeof (m). name . name , " :" , " " ^ padding, " A_mul_B!(m3, m1, m2) takes " , prettytime (time (result)), " , " , prettymemory (memory (result)), " (GC " , prettytime (gctime (result)) , " )" )
64
+ padding = maxnamelength - length (string (nameof ( typeof (m)) ))
65
+ println (nameof ( typeof (m)) , " :" , " " ^ padding, " A_mul_B!(m3, m1, m2) takes " , prettytime (time (result)), " , " , prettymemory (memory (result)), " (GC " , prettytime (gctime (result)) , " )" )
66
66
end
67
67
68
68
println ()
0 commit comments