Skip to content

LeanRows v0.4.0

Choose a tag to compare

@github-actions github-actions released this 02 Nov 20:43
· 22 commits to main since this release
f62a7d6

LeanRows 0.4.0

LeanRows 0.4.0 sorts a whole file by any column. Sorting was contributed by
@w3bgr3p in
#9. Thank you.

Everything from 0.3.0 works as before. Sorting works on CSV, TSV, JSONL,
NDJSON, log, and text files, not yet on .xlsx workbooks.

Column sorting

  • Click a column header to sort the whole file ascending. Click it again to
    reverse the order.
  • Right-click a header to choose text or numeric order. The overflow menu has
    the same commands for the last sorted column.
  • Click the Row header, or choose Restore source order, to go back to the
    file's own order. Cancel sort stops a sort that is still running and keeps
    the view you had.
  • Text order compares the full value, case sensitively, byte by byte. Numeric
    order compares integers, decimals, and scientific notation exactly, without
    rounding. In numeric order, numbers come first, then text, then empty
    values, in both directions. Rows with equal values keep their original
    order.
  • Row numbers, Find, and Go to row still use the file's original row numbers,
    so a row keeps its number after sorting.
  • The file is never changed and no database is created.

Memory and disk

Sorting is limited to 16 MiB of memory. Larger files are sorted in passes
through temporary files under %LOCALAPPDATA%\LeanRows\sort-cache, which are
removed when the tab is closed or the file reloaded, and on the next start
after a crash.

A sort needs about 256 bytes of temporary disk space per row at its peak, about
2.4 GB for 10 million rows. The limit is 8 GiB, so files above roughly 33
million rows cannot be sorted. LeanRows checks the space before it starts and
says how much it needs if the drive, or the limit, is too small.

One sort runs at a time. A sort started in another tab waits for it to finish.

Measured

On a Windows 11 laptop (16 GB RAM), with a 52.5 MB CSV of 1,000,000 shuffled
rows and three columns, sorted by the first column in text order, three runs
with the release build of this version:

Step Result
Peak working set after opening the file 18.0 to 18.9 MiB
Peak working set while sorting 20.6 MiB
Sort time 27.5 to 27.8 s

Before the final changes, on the same machine, a 10,000,000-row file opened at
about 18 MiB, peaked at about 21 MiB while sorting, and took 344 to 356 s to
sort. Opening a file uses the same memory as 0.3.0.

The executable is 918,528 bytes, up from 755,200 in 0.3.0.

Known gaps

  • Sorting and Find do not work on .xlsx workbooks yet. Sorting says so
    instead of sorting.
  • Sorting a large file is slow: about 6 minutes for 10 million rows. A faster
    merge is planned.
  • A number with a very large exponent, such as 1e999999999999999999999, makes
    a numeric sort fail with a message instead of placing it.
  • The installer and the Store package do not register .xlsx.
  • The full local QA run with a receipt, as recorded for 0.2.0, has not been run
    for 0.4.0.