Created
May 14, 2015 09:13
-
-
Save ScottPJones/e7c38085a3c391578261 to your computer and use it in GitHub Desktop.
New time macro results
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ulia> @time for i=1:1000 | |
x = utf16("this is a test\u80\uff\u7ff\uffff\U10ffff") | |
end | |
140.447 microseconds (2000 allocations: 44925 KB) | |
julia> @time for i=1:10 | |
x = utf16("this is a test\u80\uff\u7ff\uffff\U10ffff") | |
end | |
5.457 microseconds (20 allocations: 44801 KB) | |
julia> @time for i=1:1 | |
x = utf16("this is a test\u80\uff\u7ff\uffff\U10ffff") | |
end | |
2.033 microseconds (2 allocations: 44800 KB) | |
julia> @time x = utf16("this is a test\u80\uff\u7ff\uffff\U10ffff") | |
791.278 microseconds (98 allocations: 44806 KB) | |
"this is a test\u80ÿ\u7ff\uffff\U10ffff" | |
julia> @time x = utf16("this is a test\u80\uff\u7ff\uffff\U10ffff") | |
6.618 microseconds (6 allocations: 44800 KB) | |
"this is a test\u80ÿ\u7ff\uffff\U10ffff" | |
julia> function foo(n) | |
for i=1:n | |
x = utf16("this is a test\u80\uff\u7ff\uffff\U10ffff") | |
end | |
end | |
foo (generic function with 1 method) | |
julia> @time foo(1) | |
3.421 milliseconds (1651 allocations: 44875 KB) | |
julia> @time foo(1000) | |
267.042 microseconds (2004 allocations: 44925 KB) | |
julia> @time foo(10000000) | |
1.108 seconds (20000 k allocations: 1264 MB, 4.78% gc time) | |
julia> @timev foo(1000) | |
195.319 microseconds (2004 allocations: 44925 KB) | |
elapsed time: 195319 nanoseconds | |
bytes allocated: 46003344 | |
allocated: 46003344 | |
poolallocs: 2004 | |
julia> @timed foo(1000) | |
(nothing,0.000185984,46003344,0.0,Base.GC_Diff(46003344,0,0,0,2004,0,0,0,0,0,0)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment