I'm not sure if this is something that has already been seen, but when I was trying to determine why
"generic" versions of a function that I had written were so much slower than separate versions, I
noticed that the slowdown was much greater under 0.4 than 0.3.7.
include it, and then do:
CheckUTF.dotest(1)
@time CheckUTF.dotest(100)
(the first time running the test simply to make sure everything is compiled)
Here are results from 0.3.7:
ASCII:: Looping 100 times, length=4194304
UTF-8: 4194304, UTF-16: 8388608, UTF-32: 16777216
Check UTF-8 elapsed time: 0.809306356 seconds (4800 bytes allocated)
Check UTF-16 elapsed time: 0.243143885 seconds (4800 bytes allocated)
Check UTF-32 elapsed time: 0.685690145 seconds (4904 bytes allocated)
Generic UTF-16 elapsed time: 1.25220144 seconds (4800 bytes allocated)
Generic UTF-32 elapsed time: 1.406372768 seconds (4800 bytes allocated)
Surrogates:: Looping 100 times, length=4718592
UTF-8: 7864320, UTF-16: 9437184, UTF-32: 18874368
Check UTF-8 elapsed time: 1.230037991 seconds (4800 bytes allocated)
Check UTF-16 elapsed time: 0.579617553 seconds (4800 bytes allocated)
Check UTF-32 elapsed time: 0.673533505 seconds (4904 bytes allocated)
Generic UTF-16 elapsed time: 1.90101083 seconds (4800 bytes allocated)
Generic UTF-32 elapsed time: 2.005780957 seconds (4800 bytes allocated)
Here are results from 0.4:
Julia Version 0.4.0-dev+4960
Commit 96b511c* (2015-05-23 19:50 UTC)
Platform Info:
System: Darwin (x86_64-apple-darwin13.4.0)
CPU: Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
LAPACK: libopenblas
LIBM: libopenlibm
LLVM: libLLVM-3.3
ASCII:: Looping 100 times, length=4194304
UTF-8: 4194304, UTF-16: 8388608, UTF-32: 16777216
Check UTF-8 679.528 milliseconds (100 allocations: 4800 bytes)
Check UTF-16 233.352 milliseconds (100 allocations: 4800 bytes)
Check UTF-32 659.472 milliseconds (102 allocations: 4880 bytes)
Generic UTF-16 7.560 seconds (100 allocations: 4800 bytes)
Generic UTF-32 7.574 seconds (100 allocations: 4800 bytes)
Surrogates:: Looping 100 times, length=4718592
UTF-8: 7864320, UTF-16: 9437184, UTF-32: 18874368
Check UTF-8 1.128 seconds (100 allocations: 4800 bytes)
Check UTF-16 640.544 milliseconds (100 allocations: 4800 bytes)
Check UTF-32 726.304 milliseconds (102 allocations: 4880 bytes)
Generic UTF-16 11.633 seconds (100 allocations: 4800 bytes)
Generic UTF-32 12.294 seconds (100 allocations: 4800 bytes)