# 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:** 2

<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, 3:56pm UTC](https://discourse.julialang.org/t/performance-read-data-from-ascii-file-replace-split/122422/2 "2024-11-08T15:56:20Z")

</div>

Can [Base.eachsplit](https://docs.julialang.org/en/v1/base/strings/#Base.eachsplit) help with allocations? Also I think similar things have been discussed previously, for example [Performance of splitting string and parsing numbers](https://discourse.julialang.org/t/performance-of-splitting-string-and-parsing-numbers/92161)

UPD: another interesting idea for `eachsplit` is [Add method `split(str, dlm, ::Val{N})` for allocation-free splitting by jakobnissen · Pull Request #43557 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/pull/43557#issuecomment-1006967727)  
" Good news: `NTuple{N}(eachsplit(str, delim))` appears to work for this with no allocation 🎉"

---

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