You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/js/README.md
+14-8
Original file line number
Diff line number
Diff line change
@@ -44,17 +44,18 @@ this example does not require that libzsv is already installed
44
44
45
45
## Performance
46
46
47
-
Running ZSV lib from Javascript is still experimental and is not yet fully optimized. Some performance challenges are
48
-
unique to web assembly + Javascript, especially where a lot of string data
47
+
Running ZSV lib from Javascript is still experimental and is not yet fully optimized.
48
+
Some performance challenges rae particular to web assembly + Javascript, e.g. where a lot of string data
49
49
is being passed between Javascript and the library (see e.g. https://hacks.mozilla.org/2019/08/webassembly-interface-types/).
50
50
51
-
Furthermore, it is unlikely that zsv-lib can approach its full performance potential
52
-
until emscripten (or gcc) [can provide a SIMD-powered movemask function](https://github.com/WebAssembly/simd/pull/201). Until then, libzsv in emscripten resorts to the "slow"
53
-
movemask, which does have a significant impact.
51
+
However, initial results are promising:
54
52
55
-
Current testing suggests that on small files (under 1 MB), zsv-lib is 30-75% faster than, for example, the `csv-parser` library. However, on larger files,
56
-
due to the aforementioned Javascript/wasm memory overhead and lack of
57
-
SIMD movemask, it can be more than 50% slower than `csv-parser`.
53
+
* Running only "count", zsv-lib is ~90%+ faster than `csv-parser` and `papaparse`
54
+
* The more cell data that is fetched, the more this advantage diminishes due to the aforementioned Javascript/wasm memory overhead.
55
+
Our benchmarking suggests that if the entire row's data is fetched, performance is about on par with both csv-parser and papaparse.
56
+
If only a portion is fetched, performance is about the same for papaparse, and faster than csv-parser (how much faster
57
+
being roughly proportional to the difference between count (~90% faster) and the
58
+
amount of total data fetched)
58
59
59
60
## All the build commands
60
61
@@ -68,6 +69,11 @@ make clean
68
69
69
70
Add MINIFY=1 to any of the above to generate minified code
0 commit comments