Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Meta Blocks President Lula's Facebook Page, Campaign Ads 2 Weeks from Election (reddit.com)
    46comments
  2. OpenAI Feared "Optics" of what might appear on Hacker News (authorsguild.org)
    131comments
  3. Does Georgism work? Five years later (astralcodexten.com)
    250comments
  4. Flip Fluid on Flip Dots (mitxela.com)
    10comments
  5. Go Concurrency Distilled (antonz.org)
    83comments
  6. PipePipe: NewPipe hard fork implementing SponsorBlock (github.com/infinityloop1308)
    228comments
  7. DeepSeek Elastic Compute (DSec) (arxiv.org)
    82comments
  8. Show HN: Reladraw – A diagram language where you decide where to place things (github.com/reladraw)
    83comments
  9. Improving site performance by shipping more CSS (github.blog)
    26comments
  10. C's Flexible Integer Sizes Were Not a Design Mistake (pikuma.com)
    31comments
  11. A searchable library of forgotten public-domain film clips from 1915 onward (movingimagearchive.com)
    26comments
  12. The internet discovers TLA+. Now what? (reasonable.io)
    5comments
  13. Biology might not be quantum, but its math is quantumlike (quantamagazine.org)
    23comments
  14. ASML says it sold 'absolutely nothing' in Europe in 2026 (tomshardware.com)
    639comments
  15. What is the size of Yemen? (2024) (theborys.substack.com)
    56comments
  16. Fifteen years later, the Apple Cards origin story (lexontech.org)
    102comments
  17. An agent used DNS to reach an external chatbot (alignment.openai.com)
    102comments
  18. Drawgent: Coding agent on a live Excalidraw canvas (tangled.org/yanndegat.tngl.sh)
    41comments
  19. Evolving programming languages in the AI era (dashbit.co)
    57comments
  20. Reverse-engineering the Intel 8087's tangent algorithm: more than CORDIC (righto.com)
    11comments
  21. Exploding variance of means of exponentials: least-squares to the rescue (francisbach.com)
    —discuss
  22. How I changed teaching after AI managed to do all my homework assignments (thelastsoftwareengineer.substack.com)
    184comments
  23. Turning GLM-5.3-Flash into a Jev-like decision model (privatemode.ai)
    38comments
  24. Promising discoveries about the potential for life on one of Saturn’s icy moons (fu-berlin.de)
    31comments
  25. How to keep enjoying programming in a world of LLMs (haskell.org)
    270comments
  26. LP Voting and Investor Consent for AIFs (taghash.io)
    —discuss
  27. Modern Object Pascal Introduction for Programmers (castle-engine.io)
    75comments
  28. Generate fonts where every LLM token is the same width (mesh.host)
    12comments
  29. Bob Mackie dressed stars–if they were brave enough (economist.com)
    2comments
  30. We Should Be Able to Change Our Languages (jimmyhmiller.com)
    20comments

Improving site performance by shipping more CSS

42 pointsby 20h agogithub.blog
26 comments
4h agoHN ↗

Sometimes, [GitHub] posts a [blog post in which they move away from] some terrible [way of doing things] I've never heard before, and it's a weird indirect way to learn how awful their other [design choices] must be.

https://xkcd.com/2071/

3h agoHN ↗

Once (like a year ago or so) stumbled upon some person's post asking for someone to help them to "fix" some section at their website. It was done !important over !important over !important over !important. Said person was really convinced all it needed was another bunch of !important because apparently that was what ai spit for them, at least at that time

3h agoHN ↗

And yet, there's been a glaring overflow bug on every repo page if the repo has a sponsor button on Firefox Android for months.

3h agoHN ↗

css-in-js? Rofl. Whats next? Html-in-js?

3h agoHN ↗

Honestly, hats off to them. It's hard to get anything done with Copilot so I'm amazed they even managed to do this.

2h agoHN ↗

There's room for improvement still. Currently, the production build is using long-dev class names. e.g. `DirectoryContent-module__Box_3__gl6dE` could be compiled to a shorter hash like `gl6DE3a2`.

If you use Vite:

  css: {
    modules: {
      generateScopedName: mode === 'production'
        ? '[hash:base64:8]'
        : '[name]__[local]___[hash:base64:5]',
      }
    }
2h agoHN ↗

Would you need a source map then for prod debugging?

2h agoHN ↗

The improvement would be shipping human-readable structure to allow easier user overrides, not that hash abomination

2h agoHN ↗

Those class names surely gzip better than hashes over the wire?

2h agoHN ↗

Here's a comparison using `brotli --best` on my app.

   53K _long.css
   38K _short.css

   11K _long.css.br
  8.9K _short.css.br

Both, dev and prod, have hashes because that's part of what CSS Modules uses to avoid collisions.

Besides download size, smaller names improve parsing speed too.

1h agoHN ↗

This.

The only thing hashing classes achieves is making it difficult for users to use ad blockers and/or custom CSS. I understand why e.g. Meta does it on their sites, but for GitHub it makes no sense.

2h agoHN ↗

Unfortunately the original blog post introducing the great CSS-in-JS system being removed is not in the "Related posts" section, would be nice to compare the thinking in the two

2h agoHN ↗

I don't know how they perceive the performance. I see 41 network requests. That's 2.1 MB of CSS over the wire, blocking rendering and hurting painting and loading speed. There's 400 KB of Tailwind, 87 KB of general CSS, plus another 200 KB of other general CSS. They need to embrace functional CSS properly. I'm sure they could have a single CSS file under 80 KB that renders everything.

1h agoHN ↗

These type of comments often come from a place of arm-chair reasoning where you might not sit on the experience of working hands-on in a large team on a large product. While it’s probably true that X kB sufficient, that amount of performance optimisation is usually not warranted at this scale. Maintaining a design system, working with scoped classes, legacy code, and dealing with the complexities of chunking and probably further challenges we are not aware of from the outside. It seems like a common sentiment on HN (maybe not you in particular) is that engineers should drop everything and work overtime on optimizing performance, when it comes to web apps

1h agoHN ↗

The beauty of functional CSS is that you can progressively transform everything. GitHub runs on entire modularized codebase, they can clean up the entire codebase within weeks, days if they use agents and see the effects of performance instantly.

1h agoHN ↗

The shitty team excuse.

Performance is not complicated. You measure something and compare the numbers. Through my career I have encountered the following failures repeatedly:

* The complete inability to measure things. This is common among people with low social intelligence. Many people in this line of work cannot measure things and form all kinds of bullshit excuses. Cannot do it all as if they are disabled. Sometimes it is laziness, sometimes it’s autism masking, and sometimes it’s stupidity/ignorance where they believe they shouldn’t have to or are superior from convention alone.

* The shitty team argument. It’s common for people to intentionally avoid or discard measures because there is fear superior performance may indicate an operating deficit. The last thing anybody in software wants is to change approach if they are on a shitty team, because corporate developers are allergic to training people. This is often justified by asking what happens if you work on a team or about new hires.

* Throwing performance data away and lying about it. This is very common when performance data provides evidence that current conventions or favorite tools harm performance. If, for example querySelectors measure 100,000 times slower than some other approaches developers will pretend the performance evidence just doesn’t exist.

* Guessing. When people suck at what they do they invent their own performance realities. When people guess at software performance they are supremely wrong more than 80% of the time and tend to be wrong by multiple orders of magnitude.

1h agoHN ↗

You’re confidently making a lot of assumptions that don’t generalize.

For example:

performance is not complicated

Not to mention all your assumptions about the motivations of people who don’t do optimization well. That one can’t possibly generalize.

39m agoHN ↗

You measure and improve the metric, but at what cost, when should you stop? Have you worked on a 1mill+ loc web app?

42m agoHN ↗

that amount of performance optimisation is usually not warranted at this scale.

Indeed, you need to waste a few years hurting user experience before investing a few years into migration and writing another "improved performance" blog post.

that engineers should drop everything and work overtime on optimizing performance

The opposite, they should work less time instead of more doing a worse job that results in scraping all their output later in a redesign

8m agoHN ↗

Isn't this backwards? Optimizing assets becomes more important with scale, not less. Not saying it is actually prioritized that way or that it would be easy but IMO the more traffic you have the more important it is to be frugal with bits.

13m agoHN ↗

FWIW, a very quick look at other comparable sites (what seems to be the main css files):

sourcehut's 128kb raw, and 28kb over the wire.

codeberg is 420kb raw, and 66kb over the wire.

44m agoHN ↗

Any time I see criticism of CSS in JS, and a move to CSS modules, I get sad they didn’t just do a bit more research. You can have both, while also not shipping any JS runtime for CSS in JS! And with TypeScript support.

https://vanilla-extract.style/

7m agoHN ↗

Using GitHub everyday, I haven't really noticed an improved performance. Actually i'd say pages are becoming slower. Browsing issues with many comments or big PR has a terrible experience as not everything gets loaded

3m agoHN ↗

Yeah. It used to be unusable on mobile and great on desktop. But desktop has in my experience honestly been slipping pretty bad last few years. Maybe I live too far from the data center or something.

One weird thing is checking whether a PR is merge:able after solving a conflict in this repo[1] for some reason takes several minutes. Maybe because there are 1000 commits in the same file. Doesn't seem UI related but weird regardless.

[1] https://github.com/MarginaliaSearch/submit-site-to-marginali...