question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Slow when HTML + CSS is large

See original GitHub issue

When I run:

▶ time node bin/minimalcss.js https://www.peterbe.com/plog-original.html -o /dev/null

It steadily takes about 6-7 seconds. That’s way too slow. Let’s see what we can do.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:21 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
leeoniyacommented, Apr 17, 2019

That’s soo cool. I’d love to experiment with making minimalcss depend on DropCSS. I love the idea of how minimalcss can get you the rendered DOM as a HTML string, including any DOM mutations (first) by things like window.onload but once it has the HTML strings (per URL) and the CSS hrefs, technically it could replace csstree+cheerio if it works out.

what would be the value-add of --use-dropcss over the DropCSS/Puppeteer demo i posted above and the same advice in its docs? if you’d like to add this option to minimalcss, then certainly feel free to do so.

Hint hint @leeoniya ^ 😃

i’m not sure i got this one 😃 did you want me to compare the diff between dropcss and minimalcss outputs of your site?

0reactions
peterbecommented, Apr 18, 2019

what would be the value-add

What I’m saying is that minimalcss current bundles two distinct pieces of functionality. A) getting the HTML B) analyzing the HTML. It’s kinda nuts that it’s all baked into 1 thing but here we are. I like all the work and effort that’s gone into (A) but I wish (B) was something you can optionally swap in and out for other solutions.

In other words, today minimalcss is puppeteer + csstree+cheerio. What --use-dropcss would do is change that to puppeteer + dropcss.

if you’d like to add this option to minimalcss, then certainly feel free to do so.

I do. But struggling to find the time. It’s easier to think and comment about it rather than writing a patch. It was my optimistic hope that you’d have the inclination but I totally understand if you don’t.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fixing a slow site iteratively - CSS-Tricks
It shows that the slow site's content is 59.9% compressed. That probably means there are more opportunities to make things even smaller. I ......
Read more >
Does bloated HTML and poor CSS slow down your site? If so ...
Yes, bloated HTML and CSS can slow down your site. But so can deeply nested containers, frameworks, large libraries, large images, slow CDNs...
Read more >
Is a larger css file slowing down Dom processing?
1 Answer 1 · Don't use @import · Always use Backup Fonts · Segregate large CSS files out into multiple Smaller ones ·...
Read more >
How To Optimize CSS for Peak Site Performance - Kinsta
Large CSS Files Take Time to Process​​ The larger your stylesheet, the longer it takes to download and process into a CSS Object...
Read more >
Optimizing CSS for faster page loads - Tomas Pustelnik
How does CSS affect load times · CSS file size and the total amount of CSS on the page (number of files). Too...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found