Skip to content

Optimizations - #44

Merged
vividvilla merged 3 commits into
masterfrom
optimizations
Aug 21, 2026
Merged

Optimizations#44
vividvilla merged 3 commits into
masterfrom
optimizations

Conversation

@vividvilla

Copy link
Copy Markdown
Owner

No description provided.

The 207KB frontend script dominated every page, so an otherwise empty
output cost 264KB before a single row. It is now gzipped and base64'd
into the page and unpacked by a small inflater, taking the floor to
146KB. --no-compress restores the readable inline source for browsers
without DecompressionStream, or for grepping the output.

The stylesheet stays uncompressed so the page is styled at first paint
rather than after the script unpacks. A --js script has to move inside
the inflater, since a plain <script> would now run before the bundle
finished unpacking and find no CsvToTable.table to work with.
--split writes the output path as a directory of separate files linked by
relative path, so a browser caches the frontend once instead of carrying
it in every page. Assets are named with a hash of their contents: an
unchanged rerun keeps the URL and the cache hit, while changed rows or a
newer binary land on a new URL that no cache can serve stale. Everything
is staged under a temporary name and renamed in only once the conversion
succeeds, so a failure cannot truncate a directory already being served.
Loading needs no fetch, so the page still opens from disk.

--serve now runs a real local HTTP server rather than opening a file://
URL, and takes an optional [HOST]:PORT. An empty host binds loopback, so
exposing the data on the network has to be written out in full and warns
when it is. Responses carry Cache-Control: no-store, since the directory
is rebuilt every run onto a port the kernel reuses, and the cleanup now
also runs on SIGTERM.
Copilot AI lite review requested due to automatic review settings August 21, 2026 18:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Size, Separate files, Serving, and Custom CSS and JavaScript had grown a
paragraph of rationale for every rule they stated. Keep the rules, the
figures, and every example, and drop the justification around them.
@vividvilla
vividvilla merged commit 4137671 into master Aug 21, 2026
2 checks passed
@vividvilla
vividvilla deleted the optimizations branch August 22, 2026 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants