Re:Grid Style Sheets – CSS polyfills from the future
by d4tocchini on Thursday March 06, 2014 @10:55AM
(#7354432)
The Cassowary Constraint Solver used in GSS is considered the most viable & perf-sensitive linear arithmetic constraint solver for real-time use-cases, hence Apple's adoption of Cassowary across iOS & OS X.
The GSS website is a good example, with about 400 atomic constraints on the homepage. Major bottleneck is reading / writing DOM, resolving element queries; not Cassowary's constraint resolution.
GSS uses the canonical JS port of Cassowary maintained by Alex Russell:
https://github.com/slightlyoff/cassowary.js
Adam Solove had a good JSConf talk on Constraint Programming in the Browser that touches on Cassowary.js & perf benefits:
Re:Grid Style Sheets – CSS polyfills from the future
by jws on Thursday March 06, 2014 @11:26AM
(#7354664)
Just an anecdatum: I used lpsolve, a general linear programming solver, to layout constraint based user interfaces with no perceptible delay to the user in a desktop situation (no network to blame)… in 1996, on an Intel 486dx50 with 16MB of RAM. I think my cell phone with 80 times the RAM and 40 times the CPU speed can probably swing it too.
Re:Grid Style Sheets – CSS polyfills from the future
by smrtinsert on Thursday March 06, 2014 @11:17AM
(#7354587)
Another article I've seen recently pitted Yahoos engineers simple set of equations vs the Carroway solver and it was slower by a 1000-10000 times or so, hah. I think ultimately the time is negligible since you'll run it maybe one or twice on a complete page.
The point is that you don't have to re code an entire set of equations for a new layout. That's big for designers to not have to involve coders (in theory).
Re:Grid Style Sheets – CSS polyfills from the future
by bergie on Thursday March 06, 2014 @11:22AM
(#7354638)
Well, web developers already have to implement design constraints into CSS. Now you just do it by manually calculating and hardcoding positions and sizes. With GSS you can offload a lot of that effort to the constraint solver.
I can imagine some complicated websites getting out of hand quite quickly.