JuliaStrings / InlineStrings.jl

Fixed-width string types for Julia
Other
45 stars 13 forks source link

Simplify converting to `Vector{UInt8}` #46

Closed nickrobinson251 closed 2 years ago

nickrobinson251 commented 2 years ago

before:

julia> s = String31("abcd_efgh")
"abcd_efgh"

julia> @time Vector{UInt8}(s);
  0.000012 seconds (2 allocations: 96 bytes)

now:

julia> @time Vector{UInt8}(s);
  0.000011 seconds (1 allocation: 64 bytes)