# CSV Reader Benchmarks: Julia Reads CSVs 10-20x Faster than Python and R

**URL:** <https://discourse.julialang.org/t/csv-reader-benchmarks-julia-reads-csvs-10-20x-faster-than-python-and-r/41974>\
**Category:** General Usage\
**Tags:** announcement\
**Created:** [June 24, 2020, 12:12pm UTC](https://discourse.julialang.org/t/csv-reader-benchmarks-julia-reads-csvs-10-20x-faster-than-python-and-r/41974 "2020-06-24T12:12:07Z")\
**Posts on this page:** 9\
**Page:** 4

<div class="post-metadata">

**Author:** ![danielw2904](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danielw2904/32/10890_2.png) [@danielw2904](https://discourse.julialang.org/u/danielw2904)\
**Post date:** [September 4, 2020, 11:53pm UTC](https://discourse.julialang.org/t/csv-reader-benchmarks-julia-reads-csvs-10-20x-faster-than-python-and-r/41974/64 "2020-09-04T23:53:33Z")

</div>

Its hard to compare vroom since

> vroom doesn’t stop to actually _read_ all of your data, it simply indexes where each record is located so it can be read later.

---

<div class="post-metadata">

**Author:** ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Post date:** [September 5, 2020, 1:26am UTC](https://discourse.julialang.org/t/csv-reader-benchmarks-julia-reads-csvs-10-20x-faster-than-python-and-r/41974/66 "2020-09-05T01:26:45Z")

</div>

> [@Yifan\_Liu](#):
>
> vroom

Except it doest not work half the time. Like lots of limitations are not mentioned. I tried it on Fannie Mae and it was slow.

---

<div class="post-metadata">

**Author:** ![aschmu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aschmu/32/23476_2.png) [@aschmu](https://discourse.julialang.org/u/aschmu)\
**Post date:** [September 7, 2020, 7:03pm UTC](https://discourse.julialang.org/t/csv-reader-benchmarks-julia-reads-csvs-10-20x-faster-than-python-and-r/41974/67 "2020-09-07T19:03:32Z")

</div>

I understand the idea but from a user’s perspective removing compilation is kind of cheating since in practice most of the time, I personally only load the data once per session so this fixed cost is something I experience. It’s pretty common as a data scientist to load a 500k x 40 csv do a bunch of data processing, try a few models and stop the Julia session before ringing and repeating the next day. The next time this process occurs I’m still experiencing this 10-15s load time. Granted it’s really not horrible but CSV.read doesn’t feel as fast **in practice** compared to pandas or data.table for small/medium sized datasets. I’m sure it blows both out of the water for huge CSVs but that’s not necessarily the majority of the use cases.

---

<div class="post-metadata">

**Author:** ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Post date:** [September 7, 2020, 7:11pm UTC](https://discourse.julialang.org/t/csv-reader-benchmarks-julia-reads-csvs-10-20x-faster-than-python-and-r/41974/68 "2020-09-07T19:11:20Z")

</div>

I disagree. If you aren’t running the script from start to finish consistently throughout your work session, you aren’t working in a way that guarantees reproducible results.

When I’m working, I run `main()` all the time! Fast CSV reading after precompilation makes my life a lot easier.

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [September 7, 2020, 7:40pm UTC](https://discourse.julialang.org/t/csv-reader-benchmarks-julia-reads-csvs-10-20x-faster-than-python-and-r/41974/69 "2020-09-07T19:40:02Z")

</div>

> [@aschmu](#):
>
> I personally only load the data once per session so this fixed cost is something I experience.

If that is the case, what is the problem? I mean, I could understand that it would be annoying if you paid that compilation price every 5-10 minutes, but once a day? 0.05% of your workday?

---

<div class="post-metadata">

**Author:** ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Post date:** [September 8, 2020, 6:36am UTC](https://discourse.julialang.org/t/csv-reader-benchmarks-julia-reads-csvs-10-20x-faster-than-python-and-r/41974/70 "2020-09-08T06:36:03Z")

</div>

> [@aschmu](#):
>
> I personally only load the data once per session so this fixed cost is something I experience.

For me, the first thing I do is load it via CSV then save it into a more efficient format like JDF.jl. That’s my `1_import_data.jl` From step 2 I load from using JDF.jl which should be faster. I saw some good benchmarks for the JLD2.jl as well but not yet tested on large dataset yet.

---

<div class="post-metadata">

**Author:** ![Gunter\_Faes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunter_faes/32/12580_2.png) [@Gunter\_Faes](https://discourse.julialang.org/u/Gunter_Faes)\
**Post date:** [September 9, 2020, 9:40am UTC](https://discourse.julialang.org/t/csv-reader-benchmarks-julia-reads-csvs-10-20x-faster-than-python-and-r/41974/71 "2020-09-09T09:40:42Z")

</div>

@aschmu, this way of working is not unusual for a data scientist. I usually load the data as data frame at the beginning of the session and if I can afford it, I make a working copy of the original data. With this working copy I then perform the analyses and can access the original data if necessary. So reading the CSV file is usually only necessary once and it does not depend on the second. So it almost doesn’t matter if I import the CSV file with R, Python or Julia.

---

<div class="post-metadata">

**Author:** ![Balinus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/balinus/32/243_2.png) [@Balinus](https://discourse.julialang.org/u/Balinus)\
**Post date:** [December 2, 2020, 3:51pm UTC](https://discourse.julialang.org/t/csv-reader-benchmarks-julia-reads-csvs-10-20x-faster-than-python-and-r/41974/72 "2020-12-02T15:51:24Z")

</div>

I think that one way of looking at it is that if you only do interactive data analysis, it does not matter much which language you use. Your idling time (thinking between commands, etc…) is far higher than computing time.

Where it does matter is when your computations and workflow is defined and you need to launch the whole process: that’s where Julia shines… assuming your calculations are important and not simply a 1min calculations.

Ideally, I like to do both in the same language, it’s much more productive.

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [March 23, 2022, 1:48pm UTC](https://discourse.julialang.org/t/csv-reader-benchmarks-julia-reads-csvs-10-20x-faster-than-python-and-r/41974/73 "2022-03-23T13:48:21Z")

</div>

Split this topic on March 23, 2022, 1:48pm UTC

5 posts were split to a new topic: [Updated CSV reader benchmarks?](https://discourse.julialang.org/t/updated-csv-reader-benchmarks/78331)

[Previous page](https://discourse.julialang.org/t/csv-reader-benchmarks-julia-reads-csvs-10-20x-faster-than-python-and-r/41974.md?page=3)
