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
julia> VERSION | |
v"0.3.7" | |
julia> dotest(1000,true) | |
ASCII: Looping 1000 times, length=8 | |
length: elapsed time: 7.674e-6 seconds (0 bytes allocated) | |
is_valid_ascii: elapsed time: 2.1853e-5 seconds (0 bytes allocated) | |
Convert to UTF-8: elapsed time: 1.2325e-5 seconds (16000 bytes allocated) | |
Convert to UTF-16:elapsed time: 0.000314615 seconds (144000 bytes allocated) |
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
_ _ _(_)_ | 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") | |
"" |
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) |
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
julia> @timev dotest(1000,true) | |
ASCII: Looping 1000 times, length=8 | |
length: 6.128 microseconds | |
is_valid_ascii: 16.227 microseconds | |
Convert to UTF-8: 18.801 microseconds (1000 allocations: 16000 bytes) | |
Convert to UTF-16: 123.615 microseconds (2000 allocations: 109 KB) | |
Convert to UTF-32: 128.039 microseconds (2000 allocations: 125 KB) | |
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
# This file is a part of Julia. License is MIT: http://julialang.org/license | |
module CheckUTF | |
if VERSION < v"0.4-" | |
typealias AbstractString String | |
typealias UInt Uint | |
typealias UInt8 Uint8 | |
typealias UInt16 Uint16 | |
typealias UInt32 Uint32 | |
end |
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
ASCII: Looping 100 times, length=8 | |
length: 1.316 microseconds | |
is_valid_ascii: 22.529 milliseconds (5600 allocations: 62722 KB, 31.40% gc time) | |
Convert to UTF-8: 1.527 microseconds (100 allocations: 1600 bytes) | |
Convert to UTF-16: 16.616 microseconds (500 allocations: 17600 bytes) | |
Convert to UTF-32: 9.947 microseconds (200 allocations: 12800 bytes) | |
ASCII:: Looping 100 times, length=8 | |
UTF-8: 8, UTF-16: 16, UTF-32: 32 |
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
ASCII: Looping 100 times, length=8 | |
length: 1.295 microseconds | |
is_valid_ascii: 25.904 milliseconds (5600 allocations: 62722 KB, 40.59% gc time) | |
Convert to UTF-8: 985 nanoseconds (100 allocations: 1600 bytes) | |
Convert to UTF-16: 8.212 microseconds (200 allocations: 11200 bytes) | |
Convert to UTF-32: 10.364 microseconds (200 allocations: 12800 bytes) | |
ASCII:: Looping 100 times, length=8 | |
UTF-8: 8, UTF-16: 16, UTF-32: 32 |
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
VERSION < v"0.4-" && (typealias AbstractString String) | |
function tst{T <: AbstractString}(str::T, max::Int) | |
local l | |
for i=1:max | |
l = length(str) | |
end | |
l | |
end | |
function cvt8{T <: AbstractString}(str::T, max::Int) | |
local out |
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
# issue #11004 (#10959) | |
module TestConvert | |
global counttest = 0 | |
global counterr = 0 | |
incrtest() = (global counttest += 1) | |
increrr() = (global counterr += 1) |
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
ASCII: Looping 1000 times, length=8 | |
length: 2.715 microseconds | |
is_valid_ascii: 150.964 milliseconds (56000 allocations: 613 MB, 10.07% gc time) | |
Convert to UTF-8: 19.096 microseconds (1000 allocations: 16000 bytes) | |
Convert to UTF-16: 85.436 microseconds (2000 allocations: 109 KB) | |
Convert to UTF-32: 95.890 microseconds (2000 allocations: 125 KB) | |
ASCII:: Looping 1000 times, length=8 | |
UTF-8: 8, UTF-16: 16, UTF-32: 32 |
OlderNewer