Skip to content

Instantly share code, notes, and snippets.

@ScottPJones
Created May 11, 2015 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ScottPJones/8f79a1ed8abb212a6370 to your computer and use it in GitHub Desktop.
Save ScottPJones/8f79a1ed8abb212a6370 to your computer and use it in GitHub Desktop.
Test C vs Julia length code
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type "help()" for help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.4.0-dev+4600 (2015-05-02 21:32 UTC)
_/ |\__'_|_|_|\__'_| | spj/u16_charlen/0dad086* (fork: 1 commits, 0 days)
|__/ | x86_64-apple-darwin14.3.0
julia> include("/d/spj/perftest.jl")
""
julia> dotest(10000,false)
ASCII:: Looping 10000 times
UTF8: sizeof=16 length=16
UTF16: sizeof=32 length=16
@inbounds UTF-8 length
elapsed time: 0.000108718 seconds (0 bytes allocated)
C UTF-8 length
elapsed time: 0.000110042 seconds (0 bytes allocated)
@inbounds UTF-16 length
elapsed time: 9.5805e-5 seconds (0 bytes allocated)
C UTF-16 length
elapsed time: 0.000123586 seconds (0 bytes allocated)
Latin1:: Looping 10000 times
UTF8: sizeof=6 length=4
UTF16: sizeof=8 length=4
@inbounds UTF-8 length
elapsed time: 8.9803e-5 seconds (0 bytes allocated)
C UTF-8 length
elapsed time: 8.2144e-5 seconds (0 bytes allocated)
@inbounds UTF-16 length
elapsed time: 6.8984e-5 seconds (0 bytes allocated)
C UTF-16 length
elapsed time: 7.4509e-5 seconds (0 bytes allocated)
2-byte:: Looping 10000 times
UTF8: sizeof=6 length=4
UTF16: sizeof=8 length=4
@inbounds UTF-8 length
elapsed time: 9.7715e-5 seconds (0 bytes allocated)
C UTF-8 length
elapsed time: 8.4754e-5 seconds (0 bytes allocated)
@inbounds UTF-16 length
elapsed time: 8.0205e-5 seconds (0 bytes allocated)
C UTF-16 length
elapsed time: 7.8392e-5 seconds (0 bytes allocated)
3-byte:: Looping 10000 times
UTF8: sizeof=8 length=4
UTF16: sizeof=8 length=4
@inbounds UTF-8 length
elapsed time: 0.000108245 seconds (0 bytes allocated)
C UTF-8 length
elapsed time: 0.000104762 seconds (0 bytes allocated)
@inbounds UTF-16 length
elapsed time: 9.3949e-5 seconds (0 bytes allocated)
C UTF-16 length
elapsed time: 0.000100803 seconds (0 bytes allocated)
4-byte:: Looping 10000 times
UTF8: sizeof=10 length=4
UTF16: sizeof=10 length=4
@inbounds UTF-8 length
elapsed time: 0.00012937 seconds (0 bytes allocated)
C UTF-8 length
elapsed time: 0.000132932 seconds (0 bytes allocated)
@inbounds UTF-16 length
elapsed time: 0.00010946 seconds (0 bytes allocated)
C UTF-16 length
elapsed time: 0.000110355 seconds (0 bytes allocated)
Surrogates:: Looping 10000 times
UTF8: sizeof=13 length=5
UTF16: sizeof=10 length=4
@inbounds UTF-8 length
elapsed time: 0.000146022 seconds (0 bytes allocated)
C UTF-8 length
elapsed time: 0.000140092 seconds (0 bytes allocated)
@inbounds UTF-16 length
elapsed time: 9.4671e-5 seconds (0 bytes allocated)
C UTF-16 length
elapsed time: 0.000119221 seconds (0 bytes allocated)
ASCII:: Looping 10000 times
UTF8: sizeof=16 length=16
UTF16: sizeof=32 length=16
@inbounds UTF-8 length
elapsed time: 0.000121529 seconds (0 bytes allocated)
C UTF-8 length
elapsed time: 0.000122376 seconds (0 bytes allocated)
@inbounds UTF-16 length
elapsed time: 0.000109527 seconds (0 bytes allocated)
C UTF-16 length
elapsed time: 0.000135949 seconds (0 bytes allocated)
Latin1:: Looping 10000 times
UTF8: sizeof=10 length=8
UTF16: sizeof=16 length=8
@inbounds UTF-8 length
elapsed time: 0.00013178 seconds (0 bytes allocated)
C UTF-8 length
elapsed time: 0.000109606 seconds (0 bytes allocated)
@inbounds UTF-16 length
elapsed time: 8.3029e-5 seconds (0 bytes allocated)
C UTF-16 length
elapsed time: 9.7757e-5 seconds (0 bytes allocated)
2-byte:: Looping 10000 times
UTF8: sizeof=12 length=8
UTF16: sizeof=16 length=8
@inbounds UTF-8 length
elapsed time: 0.000124261 seconds (0 bytes allocated)
C UTF-8 length
elapsed time: 0.0001036 seconds (0 bytes allocated)
@inbounds UTF-16 length
elapsed time: 8.2917e-5 seconds (0 bytes allocated)
C UTF-16 length
elapsed time: 9.7712e-5 seconds (0 bytes allocated)
3-byte:: Looping 10000 times
UTF8: sizeof=14 length=8
UTF16: sizeof=16 length=8
@inbounds UTF-8 length
elapsed time: 0.000141903 seconds (0 bytes allocated)
C UTF-8 length
elapsed time: 0.000132069 seconds (0 bytes allocated)
@inbounds UTF-16 length
elapsed time: 7.621e-5 seconds (0 bytes allocated)
C UTF-16 length
elapsed time: 8.9763e-5 seconds (0 bytes allocated)
4-byte:: Looping 10000 times
UTF8: sizeof=15 length=8
UTF16: sizeof=18 length=8
@inbounds UTF-8 length
elapsed time: 0.000138564 seconds (0 bytes allocated)
C UTF-8 length
elapsed time: 0.000122275 seconds (0 bytes allocated)
@inbounds UTF-16 length
elapsed time: 8.1646e-5 seconds (0 bytes allocated)
C UTF-16 length
elapsed time: 0.000111434 seconds (0 bytes allocated)
Surrogates:: Looping 10000 times
UTF8: sizeof=17 length=9
UTF16: sizeof=18 length=8
@inbounds UTF-8 length
elapsed time: 0.000119595 seconds (0 bytes allocated)
C UTF-8 length
elapsed time: 0.000125673 seconds (0 bytes allocated)
@inbounds UTF-16 length
elapsed time: 0.000129998 seconds (0 bytes allocated)
C UTF-16 length
elapsed time: 0.000143632 seconds (0 bytes allocated)
ASCII:: Looping 10000 times
UTF8: sizeof=64 length=64
UTF16: sizeof=128 length=64
@inbounds UTF-8 length
elapsed time: 0.000298368 seconds (0 bytes allocated)
C UTF-8 length
elapsed time: 0.000318798 seconds (0 bytes allocated)
@inbounds UTF-16 length
elapsed time: 0.000251448 seconds (0 bytes allocated)
C UTF-16 length
elapsed time: 0.000327425 seconds (0 bytes allocated)
Latin1:: Looping 10000 times
UTF8: sizeof=84 length=64
UTF16: sizeof=128 length=64
@inbounds UTF-8 length
elapsed time: 0.000372697 seconds (0 bytes allocated)
C UTF-8 length
elapsed time: 0.000390553 seconds (0 bytes allocated)
@inbounds UTF-16 length
elapsed time: 0.000245566 seconds (0 bytes allocated)
C UTF-16 length
elapsed time: 0.000322757 seconds (0 bytes allocated)
2-byte:: Looping 10000 times
UTF8: sizeof=84 length=64
UTF16: sizeof=128 length=64
@inbounds UTF-8 length
elapsed time: 0.000372667 seconds (0 bytes allocated)
C UTF-8 length
elapsed time: 0.000435712 seconds (0 bytes allocated)
@inbounds UTF-16 length
elapsed time: 0.000278359 seconds (0 bytes allocated)
C UTF-16 length
elapsed time: 0.000382197 seconds (0 bytes allocated)
3-byte:: Looping 10000 times
UTF8: sizeof=92 length=64
UTF16: sizeof=128 length=64
@inbounds UTF-8 length
elapsed time: 0.000401804 seconds (0 bytes allocated)
C UTF-8 length
elapsed time: 0.000424889 seconds (0 bytes allocated)
@inbounds UTF-16 length
elapsed time: 0.000265441 seconds (0 bytes allocated)
C UTF-16 length
elapsed time: 0.000344794 seconds (0 bytes allocated)
4-byte:: Looping 10000 times
UTF8: sizeof=104 length=64
UTF16: sizeof=144 length=64
@inbounds UTF-8 length
elapsed time: 0.000428876 seconds (0 bytes allocated)
C UTF-8 length
elapsed time: 0.000485865 seconds (0 bytes allocated)
@inbounds UTF-16 length
elapsed time: 0.000274815 seconds (0 bytes allocated)
C UTF-16 length
elapsed time: 0.000371448 seconds (0 bytes allocated)
Surrogates:: Looping 10000 times
UTF8: sizeof=120 length=72
UTF16: sizeof=144 length=64
@inbounds UTF-8 length
elapsed time: 0.000485837 seconds (0 bytes allocated)
C UTF-8 length
elapsed time: 0.000554557 seconds (0 bytes allocated)
@inbounds UTF-16 length
elapsed time: 0.000274817 seconds (0 bytes allocated)
C UTF-16 length
elapsed time: 0.00035516 seconds (0 bytes allocated)
ASCII:: Looping 10000 times
UTF8: sizeof=256 length=256
UTF16: sizeof=512 length=256
@inbounds UTF-8 length
elapsed time: 0.00105902 seconds (0 bytes allocated)
C UTF-8 length
elapsed time: 0.001140434 seconds (0 bytes allocated)
@inbounds UTF-16 length
elapsed time: 0.000912813 seconds (0 bytes allocated)
C UTF-16 length
elapsed time: 0.001202819 seconds (0 bytes allocated)
Latin1:: Looping 10000 times
UTF8: sizeof=336 length=256
UTF16: sizeof=512 length=256
@inbounds UTF-8 length
elapsed time: 0.001335094 seconds (0 bytes allocated)
C UTF-8 length
elapsed time: 0.001517319 seconds (0 bytes allocated)
@inbounds UTF-16 length
elapsed time: 0.000928689 seconds (0 bytes allocated)
C UTF-16 length
elapsed time: 0.001201193 seconds (0 bytes allocated)
2-byte:: Looping 10000 times
UTF8: sizeof=336 length=256
UTF16: sizeof=512 length=256
@inbounds UTF-8 length
elapsed time: 0.001388563 seconds (0 bytes allocated)
C UTF-8 length
elapsed time: 0.001513445 seconds (0 bytes allocated)
@inbounds UTF-16 length
elapsed time: 0.000973031 seconds (0 bytes allocated)
C UTF-16 length
elapsed time: 0.001243973 seconds (0 bytes allocated)
3-byte:: Looping 10000 times
UTF8: sizeof=368 length=256
UTF16: sizeof=512 length=256
@inbounds UTF-8 length
elapsed time: 0.001460029 seconds (0 bytes allocated)
C UTF-8 length
elapsed time: 0.001689846 seconds (0 bytes allocated)
@inbounds UTF-16 length
elapsed time: 0.000910168 seconds (0 bytes allocated)
C UTF-16 length
elapsed time: 0.001222248 seconds (0 bytes allocated)
4-byte:: Looping 10000 times
UTF8: sizeof=416 length=256
UTF16: sizeof=576 length=256
@inbounds UTF-8 length
elapsed time: 0.001646707 seconds (0 bytes allocated)
C UTF-8 length
elapsed time: 0.001871561 seconds (0 bytes allocated)
@inbounds UTF-16 length
elapsed time: 0.000985478 seconds (0 bytes allocated)
C UTF-16 length
elapsed time: 0.001403591 seconds (0 bytes allocated)
Surrogates:: Looping 10000 times
UTF8: sizeof=480 length=288
UTF16: sizeof=576 length=256
@inbounds UTF-8 length
elapsed time: 0.001999665 seconds (0 bytes allocated)
C UTF-8 length
elapsed time: 0.002362433 seconds (0 bytes allocated)
@inbounds UTF-16 length
elapsed time: 0.001161965 seconds (0 bytes allocated)
C UTF-16 length
elapsed time: 0.00142065 seconds (0 bytes allocated)
ASCII:: Looping 10000 times
UTF8: sizeof=1024 length=1024
UTF16: sizeof=2048 length=1024
@inbounds UTF-8 length
elapsed time: 0.004338224 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 0.004557144 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 0.00337676 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 0.00469715 seconds (156 kB allocated)
Latin1:: Looping 10000 times
UTF8: sizeof=1344 length=1024
UTF16: sizeof=2048 length=1024
@inbounds UTF-8 length
elapsed time: 0.005230908 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 0.005990468 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 0.003575621 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 0.004630061 seconds (156 kB allocated)
2-byte:: Looping 10000 times
UTF8: sizeof=1344 length=1024
UTF16: sizeof=2048 length=1024
@inbounds UTF-8 length
elapsed time: 0.005264174 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 0.006558095 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 0.00353115 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 0.004582145 seconds (156 kB allocated)
3-byte:: Looping 10000 times
UTF8: sizeof=1472 length=1024
UTF16: sizeof=2048 length=1024
@inbounds UTF-8 length
elapsed time: 0.00564546 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 0.00660883 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 0.003420645 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 0.004693831 seconds (156 kB allocated)
4-byte:: Looping 10000 times
UTF8: sizeof=1664 length=1024
UTF16: sizeof=2304 length=1024
@inbounds UTF-8 length
elapsed time: 0.006294988 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 0.00717057 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 0.004147844 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 0.005264367 seconds (156 kB allocated)
Surrogates:: Looping 10000 times
UTF8: sizeof=1920 length=1152
UTF16: sizeof=2304 length=1024
@inbounds UTF-8 length
elapsed time: 0.007223624 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 0.008640475 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 0.003925583 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 0.00505397 seconds (156 kB allocated)
ASCII:: Looping 10000 times
UTF8: sizeof=4096 length=4096
UTF16: sizeof=8192 length=4096
@inbounds UTF-8 length
elapsed time: 0.015160009 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 0.017742877 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 0.012875046 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 0.017375879 seconds (156 kB allocated)
Latin1:: Looping 10000 times
UTF8: sizeof=5376 length=4096
UTF16: sizeof=8192 length=4096
@inbounds UTF-8 length
elapsed time: 0.020248195 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 0.023285311 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 0.016304499 seconds (156 kB allocated, 18.70% gc time in 1 pauses with 0 full sweep)
C UTF-16 length
elapsed time: 0.018178014 seconds (156 kB allocated)
2-byte:: Looping 10000 times
UTF8: sizeof=5376 length=4096
UTF16: sizeof=8192 length=4096
@inbounds UTF-8 length
elapsed time: 0.0199719 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 0.022443819 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 0.013416439 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 0.018126432 seconds (156 kB allocated)
3-byte:: Looping 10000 times
UTF8: sizeof=5888 length=4096
UTF16: sizeof=8192 length=4096
@inbounds UTF-8 length
elapsed time: 0.021691246 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 0.025241601 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 0.013062426 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 0.017154132 seconds (156 kB allocated)
4-byte:: Looping 10000 times
UTF8: sizeof=6656 length=4096
UTF16: sizeof=9216 length=4096
@inbounds UTF-8 length
elapsed time: 0.024606025 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 0.028266909 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 0.014812111 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 0.019725344 seconds (156 kB allocated)
Surrogates:: Looping 10000 times
UTF8: sizeof=7680 length=4608
UTF16: sizeof=9216 length=4096
@inbounds UTF-8 length
elapsed time: 0.027931482 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 0.032920443 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 0.014639067 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 0.019951087 seconds (156 kB allocated)
ASCII:: Looping 10000 times
UTF8: sizeof=16384 length=16384
UTF16: sizeof=32768 length=16384
@inbounds UTF-8 length
elapsed time: 0.060011101 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 0.070018122 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 0.052630586 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 0.069118051 seconds (156 kB allocated)
Latin1:: Looping 10000 times
UTF8: sizeof=21504 length=16384
UTF16: sizeof=32768 length=16384
@inbounds UTF-8 length
elapsed time: 0.081098402 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 0.091836198 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 0.056127963 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 0.071729398 seconds (156 kB allocated)
2-byte:: Looping 10000 times
UTF8: sizeof=21504 length=16384
UTF16: sizeof=32768 length=16384
@inbounds UTF-8 length
elapsed time: 0.077940973 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 0.09331921 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 0.052084199 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 0.071602776 seconds (156 kB allocated)
3-byte:: Looping 10000 times
UTF8: sizeof=23552 length=16384
UTF16: sizeof=32768 length=16384
@inbounds UTF-8 length
elapsed time: 0.087842116 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 0.109024109 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 0.055701671 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 0.07258801 seconds (156 kB allocated)
4-byte:: Looping 10000 times
UTF8: sizeof=26624 length=16384
UTF16: sizeof=36864 length=16384
@inbounds UTF-8 length
elapsed time: 0.102777545 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 0.119692902 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 0.059619774 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 0.07923278 seconds (156 kB allocated)
Surrogates:: Looping 10000 times
UTF8: sizeof=30720 length=18432
UTF16: sizeof=36864 length=16384
@inbounds UTF-8 length
elapsed time: 0.11331059 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 0.129360767 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 0.059218651 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 0.080105137 seconds (156 kB allocated)
ASCII:: Looping 10000 times
UTF8: sizeof=65536 length=65536
UTF16: sizeof=131072 length=65536
@inbounds UTF-8 length
elapsed time: 0.244832435 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 0.280727985 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 0.210040836 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 0.283834564 seconds (156 kB allocated)
Latin1:: Looping 10000 times
UTF8: sizeof=86016 length=65536
UTF16: sizeof=131072 length=65536
@inbounds UTF-8 length
elapsed time: 0.321916412 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 0.36906558 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 0.221102895 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 0.295305392 seconds (156 kB allocated)
2-byte:: Looping 10000 times
UTF8: sizeof=86016 length=65536
UTF16: sizeof=131072 length=65536
@inbounds UTF-8 length
elapsed time: 0.340968848 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 0.379907847 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 0.217879637 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 0.280763977 seconds (156 kB allocated)
3-byte:: Looping 10000 times
UTF8: sizeof=94208 length=65536
UTF16: sizeof=131072 length=65536
@inbounds UTF-8 length
elapsed time: 0.349948033 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 0.409456814 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 0.222725364 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 0.290926394 seconds (156 kB allocated)
4-byte:: Looping 10000 times
UTF8: sizeof=106496 length=65536
UTF16: sizeof=147456 length=65536
@inbounds UTF-8 length
elapsed time: 0.401263927 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 0.457844047 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 0.242805198 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 0.322549289 seconds (156 kB allocated)
Surrogates:: Looping 10000 times
UTF8: sizeof=122880 length=73728
UTF16: sizeof=147456 length=65536
@inbounds UTF-8 length
elapsed time: 0.469272552 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 0.532802045 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 0.240901124 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 0.340966883 seconds (156 kB allocated)
ASCII:: Looping 10000 times
UTF8: sizeof=262144 length=262144
UTF16: sizeof=524288 length=262144
@inbounds UTF-8 length
elapsed time: 1.005612835 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 1.13384973 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 0.881215724 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 1.183960176 seconds (156 kB allocated)
Latin1:: Looping 10000 times
UTF8: sizeof=344064 length=262144
UTF16: sizeof=524288 length=262144
@inbounds UTF-8 length
elapsed time: 1.342536944 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 1.514897581 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 0.982945876 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 1.164232353 seconds (156 kB allocated)
2-byte:: Looping 10000 times
UTF8: sizeof=344064 length=262144
UTF16: sizeof=524288 length=262144
@inbounds UTF-8 length
elapsed time: 1.304726145 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 1.529124959 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 0.87415772 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 1.184261414 seconds (156 kB allocated)
3-byte:: Looping 10000 times
UTF8: sizeof=376832 length=262144
UTF16: sizeof=524288 length=262144
@inbounds UTF-8 length
elapsed time: 1.480191525 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 1.714687742 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 0.879951623 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 1.164990253 seconds (156 kB allocated)
4-byte:: Looping 10000 times
UTF8: sizeof=425984 length=262144
UTF16: sizeof=589824 length=262144
@inbounds UTF-8 length
elapsed time: 1.635859832 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 1.893796416 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 1.039556176 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 1.32969235 seconds (156 kB allocated)
Surrogates:: Looping 10000 times
UTF8: sizeof=491520 length=294912
UTF16: sizeof=589824 length=262144
@inbounds UTF-8 length
elapsed time: 1.905948226 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 2.143393496 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 1.004016709 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 1.302153753 seconds (156 kB allocated)
ASCII:: Looping 10000 times
UTF8: sizeof=1048576 length=1048576
UTF16: sizeof=2097152 length=1048576
@inbounds UTF-8 length
elapsed time: 4.041630529 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 4.631515389 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 3.461636597 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 4.569627641 seconds (156 kB allocated)
Latin1:: Looping 10000 times
UTF8: sizeof=1376256 length=1048576
UTF16: sizeof=2097152 length=1048576
@inbounds UTF-8 length
elapsed time: 5.176095264 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 5.905660665 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 3.436718049 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 4.515865512 seconds (156 kB allocated)
2-byte:: Looping 10000 times
UTF8: sizeof=1376256 length=1048576
UTF16: sizeof=2097152 length=1048576
@inbounds UTF-8 length
elapsed time: 5.125538108 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 5.88440767 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 3.372854042 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 4.527203365 seconds (156 kB allocated)
3-byte:: Looping 10000 times
UTF8: sizeof=1507328 length=1048576
UTF16: sizeof=2097152 length=1048576
@inbounds UTF-8 length
elapsed time: 5.664227283 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 6.422698601 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 3.378749599 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 4.481300561 seconds (156 kB allocated)
4-byte:: Looping 10000 times
UTF8: sizeof=1703936 length=1048576
UTF16: sizeof=2359296 length=1048576
@inbounds UTF-8 length
elapsed time: 6.317540867 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 7.242946566 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 3.781139116 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 5.175721714 seconds (156 kB allocated)
Surrogates:: Looping 10000 times
UTF8: sizeof=1966080 length=1179648
UTF16: sizeof=2359296 length=1048576
@inbounds UTF-8 length
elapsed time: 7.22433344 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 8.31333456 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 3.808632569 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 5.000187687 seconds (156 kB allocated)
ASCII:: Looping 10000 times
UTF8: sizeof=4194304 length=4194304
UTF16: sizeof=8388608 length=4194304
@inbounds UTF-8 length
elapsed time: 15.550127468 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 17.836231165 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 13.840276678 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 18.560157525 seconds (156 kB allocated)
Latin1:: Looping 10000 times
UTF8: sizeof=5505024 length=4194304
UTF16: sizeof=8388608 length=4194304
@inbounds UTF-8 length
elapsed time: 20.935721656 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 23.6878599 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 13.933889104 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 18.385488311 seconds (156 kB allocated)
2-byte:: Looping 10000 times
UTF8: sizeof=5505024 length=4194304
UTF16: sizeof=8388608 length=4194304
@inbounds UTF-8 length
elapsed time: 20.606046058 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 23.664971081 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 13.928392612 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 18.28507707 seconds (156 kB allocated)
3-byte:: Looping 10000 times
UTF8: sizeof=6029312 length=4194304
UTF16: sizeof=8388608 length=4194304
@inbounds UTF-8 length
elapsed time: 22.700074059 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 25.989720455 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 13.928189559 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 18.365905424 seconds (156 kB allocated)
4-byte:: Looping 10000 times
UTF8: sizeof=6815744 length=4194304
UTF16: sizeof=9437184 length=4194304
@inbounds UTF-8 length
elapsed time: 25.640387843 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 29.358130811 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 16.130950592 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 21.042736177 seconds (156 kB allocated)
Surrogates:: Looping 10000 times
UTF8: sizeof=7864320 length=4718592
UTF16: sizeof=9437184 length=4194304
@inbounds UTF-8 length
elapsed time: 30.347250908 seconds (156 kB allocated)
C UTF-8 length
elapsed time: 34.760781208 seconds (156 kB allocated)
@inbounds UTF-16 length
elapsed time: 16.461831025 seconds (156 kB allocated)
C UTF-16 length
elapsed time: 22.562154155 seconds (156 kB allocated)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment