Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
fb96984
mojo_csv
Phelsong Mar 12, 2025
0cccda6
Update recipe.yaml for CI
Mar 13, 2025
4799442
unquote for ci
Phelsong Mar 19, 2025
532a532
update test
Phelsong Mar 25, 2025
acae1eb
Merge branch 'main' into main
carolinefrasca Apr 14, 2025
a79c0d9
Update source git URL
carolinefrasca Apr 14, 2025
e93d802
change tests syntax
carolinefrasca Apr 14, 2025
0468a4a
Merge branch 'main' into main
carolinefrasca Apr 14, 2025
9b83dea
Merge branch 'main' into main
Phelsong Apr 23, 2025
28c6b0b
Merge branch 'main' into main
Phelsong Apr 29, 2025
181b35b
Merge branch 'main' into main
carolinefrasca Apr 30, 2025
63c9619
Merge branch 'main' into main
carolinefrasca Apr 30, 2025
811f118
verify 25.3.0 and update test
Phelsong Jun 3, 2025
433e85f
Merge branch 'main' into main
Phelsong Jun 3, 2025
87058f1
Merge branch 'main' into main
carolinefrasca Jun 3, 2025
95caa34
update test
Phelsong Jun 5, 2025
564d561
Merge remote-tracking branch 'origin/main'
Phelsong Jun 5, 2025
5a4d112
Merge branch 'main' into main
Phelsong Jun 5, 2025
ed4bd1a
Merge branch 'main' into main
carolinefrasca Jun 5, 2025
e36062c
update csv path
Phelsong Jun 5, 2025
5107692
Merge branch 'main' into main
Phelsong Jun 5, 2025
30ed096
Merge branch 'main' into main
carolinefrasca Jun 9, 2025
770b35c
update test to cwd
Phelsong Jun 10, 2025
0967a1b
Merge remote-tracking branch 'origin/main'
Phelsong Jun 10, 2025
8a55ce0
Merge branch 'main' into main
Phelsong Jun 10, 2025
fb67417
update build and versioning
Phelsong Jun 18, 2025
3203ee0
Merge branch 'main' into main
Phelsong Jun 18, 2025
c02eef6
add logo
Phelsong Jun 19, 2025
378904b
update readme
Phelsong Jun 19, 2025
55ac9cb
Merge branch 'main' into main
carolinefrasca Jun 24, 2025
ccd9da8
update mojo_csv to 1.3
Phelsong Jul 7, 2025
80e98ad
Merge branch 'main' into main
Phelsong Jul 7, 2025
573e99f
1.4.0
Phelsong Jul 21, 2025
14c23d3
update mojo_csv to 1.4.0
Phelsong Jul 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 35 additions & 15 deletions recipes/mojo_csv/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

<!-- ![mojo_csv_logo](./mojo_csv_logo.png) -->
<image src='./mojo_csv_logo.png' width='900'/>

Expand All @@ -18,7 +19,6 @@ channels = ["conda-forge", "https://conda.modular.com/max", "https://repo.prefix

`pixi add mojo_csv`


##### Basic Usage

```mojo
Expand Down Expand Up @@ -46,6 +46,8 @@ fn main():
```

#### BETA
1.4.0 will be the last version where this isn't the default

```mojo
ThreadedCsvReader(
file_path: Path,
Expand Down Expand Up @@ -85,7 +87,6 @@ var reader = ThreadedCsvReader(
num_threads=8
)


### Attributes

```mojo
Expand All @@ -96,8 +97,7 @@ reader.row_count : Int # total number of rows T->B
reader.column_count : Int # total number of columns L->R
reader.elements : List[String] # all delimited elements
reader.length : Int # total number of elements

```
````

##### Indexing

Expand All @@ -107,7 +107,6 @@ currently the array is only 1D, so indexing is fairly manual.
reader[0] # first element
```


### Performance

- average times over 1k iterations
Expand All @@ -125,31 +124,52 @@ large file benchmark (2m rows)
✨ Pixi task (bench): mojo bench.mojo
running benchmark for micro csv:
average time in ms for micro file:
0.007699
0.01875
-------------------------
running benchmark for mini csv:
average time in ms for mini file:
0.241136
0.07328
-------------------------
running benchmark for small csv:
average time in ms for small file:
1.388513
0.417368
-------------------------
running benchmark for medium csv:
average time in ms for medium file:
121.217188
36.45899
-------------------------
running benchmark for large csv:
average time in ms for large file:
3582.876541
1253.19458
```

Performance comparison on various file sizes (average of multiple runs):
=== ThreadedCsvReader Performance Comparison ===

| File Size | Single-threaded | Multi-threaded | Speedup |
| ------------ | --------------- | -------------- | ------- |
| 1,000 rows | 1.42ms | 1.30ms | 1.09x |
| 100,000 rows | 125ms | 105ms | 1.19x |
Small file benchmark (1,000 rows):
Single-threaded:
Average time: 0.500384 ms
Multi-threaded:
Average time: 0.451094 ms
Speedup: 1.11 x
-------------------------
Medium file benchmark (100,000 rows):
Single-threaded:
Average time: 38.124275 ms
Multi-threaded:
Average time: 24.650092 ms
Speedup: 1.55 x
-------------------------
Large file benchmark (2,000,000 rows):
Single-threaded:
Average time: 1175.345429 ms
Multi-threaded:
Average time: 830.02685 ms
Speedup: 1.42 x
-------------------------
Summary:
Small file speedup: 1.11 x
Medium file speedup: 1.55 x
Large file speedup: 1.42 x

_Tested on AMD 7950x (16 cores) @ 5.8GHz_

Expand Down
4 changes: 2 additions & 2 deletions recipes/mojo_csv/recipe.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
context:
version: 1.3.0
version: 1.4.0


package:
Expand All @@ -8,7 +8,7 @@ package:

source:
- git: https://github.com/Phelsong/mojo_csv.git
rev: 4d6643f27fe15e86263cdc66fd383cf345811228
rev: d92e7b72933445c71c463d3f9eb52404dd01edf2


build:
Expand Down
Loading