JuliaLang/julia — pull request #1884 by diegozea (2013-01-04 04:04:00+00:00)
Title: faster lowercase and uppercase

Using *uppercase(Uint8,)* and *lowercase(Uint8,)* [ both defined using *ccall* on *string.jl* ] is faster than the pure Julia *lower/uppercase(ASCIIString,)* implementation.

Benchmark:
```
julia> b=convert(ASCIIString,repeat("abcdef",100000));

julia> for i in 1:5
println("---------------------------------------------------------------------------------------------------------------")
println("previous uppercase:")
@timeit uppercase(b)
println("using uppercase(Uint8,):")
@timeit uppercase2(b)
end
---------------------------------------------------------------------------------------------------------------
previous uppercase:
Mean	SD	N	Min:	2.5549374573619654	0.07316954602845514	141	2.532958984375
using uppercase(Uint8,):
Mean	SD	N	Min:	2.0886501135853672	0.06681727602045176	173	2.043008804321289
---------------------------------------------------------------------------------------------------------------
previous uppercase:
Mean	SD	N	Min:	2.560585103136428	0.07868263538822672	141	2.5289058685302734
using uppercase(Uint8,):
Mean	SD	N	Min:	2.083949270965047	0.060214738113332104	173	2.039194107055664
---------------------------------------------------------------------------------------------------------------
previous uppercase:
Mean	SD	N	Min:	2.5698648276903953	0.08722755484490761	141	2.5289058685302734
using uppercase(Uint8,):
Mean	SD	N	Min:	2.0806378331677666	0.05486057951368713	174	2.03704833984375
---------------------------------------------------------------------------------------------------------------
previous uppercase:
Mean	SD	N	Min:	2.563787690291168	0.07733692736721635	141	2.529144287109375
using uppercase(Uint8,):
Mean	SD	N	Min:	2.083691558396885	0.05892405530791618	173	2.03704833984375
---------------------------------------------------------------------------------------------------------------
previous uppercase:
Mean	SD	N	Min:	2.5600778295638715	0.08236377961843203	141	2.5289058685302734
using uppercase(Uint8,):
Mean	SD	N	Min:	2.0866049507449818	0.06345176087902686	173	2.0341873168945312

```