[with apologies to Jack for the duplicate]
On 8/2/13 3:26 PM, Jack Moffitt wrote:
Simon, Josh, Keegan, and I all reviewed rust-cssparser[1] this morning
since it got added to the tree in one big go. The summary of that
meeting is here:
https://github.com/mozilla/servo/wiki/Rust-cssparser-code-walk-2013-08-02
Some general comments:
1) How fast is a Reader in practice? Gecko used to use an input stream
for the parser and switched to a flat character buffer because it was
significantly faster, even if you ignore the cost of Read() calls: the
logic getting the next char became much simpler and compilers became
able to optimize tight loops around it (like number parsing, say) a lot
better. Before that change, the register spills caused by the possible
function call to fill the buffer from the stream meant the
number-parsing loop code was terrible.
So in practice, parsing from a character buffer might be the right
thing, especially because it's not like we necessarily need incremental
parsing for CSS.
There's a microbenchmark in
https://bugzilla.mozilla.org/show_bug.cgi?id=498559 if people are
interested.
2) Storing final parsed numbers as i32 and f32 is ok in most (all?)
cases, I suspect, but have to be a bit careful with intermediate values
when parsing of course.
-Boris
_______________________________________________
dev-servo mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-servo