Skip to content

About

make.fun entry: fast csv-reader-compatible CSV parser

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

makefun-csv-reader-speed

csv-reader-speed-01-run-20261121 rank reward

A fast, dependency-free drop-in for csv-reader 1.0.0: run(input) returns, for {text, header}, exactly the {columns, rows, errors} csv-reader returns — including its broken-row policy (BOM drop, LF/CRLF record ends, stray CRs, quoted fields with "" escapes, CRLF/lone CR inside quotes read as LF, quote junk, unterminated quotes re-read as unquoted, short/long row padding and cutting with errors in order met).

How it is fast: a record holding no quote and no stray CR is taken whole with one slice + split(','); other records are read field by field, jumping between delimiters with one regex scan per field instead of walking character by character. On the practice set it parses in ~0.16 s where csv-reader 1.0.0 takes ~0.46 s on the same machine.

Layout

  • solve.js — the parser: export function run(input).
  • main.ts — the driver the harness runs: reads every case from /input/cases.json, answers each with run, writes /output/answers.json.

License

MIT — see LICENSE.

About

make.fun entry: fast csv-reader-compatible CSV parser

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages