# Performance: read data from ascii file, replace \`split\`

**URL:** <https://discourse.julialang.org/t/performance-read-data-from-ascii-file-replace-split/122422>\
**Category:** General Usage\
**Tags:** performance\
**Created:** [November 8, 2024, 3:35pm UTC](https://discourse.julialang.org/t/performance-read-data-from-ascii-file-replace-split/122422 "2024-11-08T15:35:01Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![artemsolod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/artemsolod/32/20704_2.png) [@artemsolod](https://discourse.julialang.org/u/artemsolod)\
**Post date:** [November 8, 2024, 8:21pm UTC](https://discourse.julialang.org/t/performance-read-data-from-ascii-file-replace-split/122422/8 "2024-11-08T20:21:04Z")

</div>

Some other suggestions I have: `CSV.jl` is multi-threaded by default so this might affect timings. Also it uses [GitHub - JuliaStrings/InlineStrings.jl: Fixed-width string types for Julia](https://github.com/JuliaStrings/InlineStrings.jl) which helps a lot to avoid allocations. Tried unrolling the loop - this helps a bit but maybe bottleneck now is not in `split` logic.

```julia
@inbounds function parse_str_unrolled(str)
    ix_beg = findfirst((==)(' '), str)
    ix_end = findnext((==)(' '), str, ix_beg+1)
    a = str[1:ix_beg-1]
    b = @views parse(Int, str[ix_beg+1:ix_end-1])
    c = @views parse(Float64, str[ix_end+1:end])
    (a, b, c)
end

```

---

_[View the full topic](https://discourse.julialang.org/t/performance-read-data-from-ascii-file-replace-split/122422)._
