Optimizations - #44
Merged
Merged
Conversation
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.
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
force-pushed
the
optimizations
branch
from
August 21, 2026 18:39
f207475 to
c59a740
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.