News for hackers. Stuff that matters.
Re:Less.js will obsolete CSS by nex3 on Sunday June 20, 2010 @02:41PM (#1446955)
Fair enough. I'm running less.js from the command line using node.js on my old-ish MacBook pro:

A trivial CSS file (foo {a: b}) takes about 0.11s. This is probably mostly time spent spawning Node and loading the JS.

The combined CSS for GitHub, about 160K, takes about 1.6s. This is already longer than most HTTP requests.

The doubled CSS for GitHub (the same CSS twice in a row), about 316K, takes about 4s. This is quite large, although there are few sites that have this much CSS.

I tried to run it against the minified CSS for caring.com, but after 2m it hadn't terminated so I gave up. It's likely that this is due to a bug in the implementation rather than slowness.

Re:Less.js will obsolete CSS by cloudhead on Sunday June 20, 2010 @10:04PM (#1447663)
That's because the parser isn't optimized for compressed CSS.

By airing the file out a bit (just adding some double line-breaks), and passing -O2, it goes down to 177ms :)

Re:Less.js will obsolete CSS by nex3 on Monday June 21, 2010 @04:18AM (#1448270)
This is real CSS handwritten by real people. It's not compressed, it's just not in a fully-expanded style. If your parser is slow for reasonably formatted CSS, then your parser is slow. The best case can be as fast as you want, but real-world use is what matters.

For what it's worth, -O2 brings the compile time for github.css down to about 1.5s.

Re:Less.js will obsolete CSS by cloudhead on Monday June 21, 2010 @06:10AM (#1448393)
The github CSS is compressed. It's fine to test worse-case scenario, but doesn't mean much.
Re:Less.js will obsolete CSS by nex3 on Monday June 21, 2010 @05:21PM (#1450120)
No it's not. Look at it: it's one-selector-per-line, which is a very common style for handwritten CSS. If it were compressed, it would have no line breaks.