>
> Looks like ccall to :jl_substrtod might be adaptable for memory efficient 
> processing if the example below can be generalized.
> cheers,
> Keith
>
>
> julia> function str_ccall(N)
>           mystr = ascii("1.1,2.2")
>           ax=Array(Float64,1)
>           sx=0
>           ex=2
>           
>           ay=Array(Float64,1)
>           sy=4
>           ey=6
>        
>           for i in 1:N
>              ccall(:jl_substrtod, Int32, (Ptr{Uint8}, Csize_t,Int, 
> Ptr{Float64}), 
>                mystr, convert(Csize_t,sx), ex, ax) 
>              ccall(:jl_substrtod, Int32, (Ptr{Uint8}, Csize_t,Int, 
> Ptr{Float64}), 
>                mystr, convert(Csize_t,sy), ey, ay) 
>           end
>            return ax, ay 
>        end
> str_ccall (generic function with 1 method)
>
> julia> @time str_ccall(4)
> elapsed time: 0.005407263 seconds (165248 bytes allocated)
> ([1.1],[2.2])
>
> julia> @time str_ccall(4)
> elapsed time: 4.713e-6 seconds (208 bytes allocated)
> ([1.1],[2.2])
>
> julia> @time str_ccall(6)
> elapsed time: 1.4191e-5 seconds (208 bytes allocated)
> ([1.1],[2.2])
>
> julia> @time str_ccall(8)
> elapsed time: 6.371e-6 seconds (208 bytes allocated)
> ([1.1],[2.2])
>

Reply via email to