[dev-servo] string-cache (string interning) is now generic

2016-11-03 Thread Simon Sapin
# How it worked until recently Servo uses a crate called string-cache for string interning. It defines an `Atom` type that represents a string (it dereferences to `&str`), but it take 8 bytes of stack space (whereas `String` take three times that on 64-bit systems) and is fast to compare for e

Re: [dev-servo] string-cache (string interning) is now generic

2016-11-03 Thread Bobby Holley
This is awesome, and fixes a long-running pain point. Thanks Simon! On Thu, Nov 3, 2016 at 12:17 PM, Simon Sapin wrote: > # How it worked until recently > > Servo uses a crate called string-cache for string interning. It defines an > `Atom` type that represents a string (it dereferences to `&str

Re: [dev-servo] string-cache (string interning) is now generic

2016-11-03 Thread Boris Zbarsky
On 11/3/16 3:17 PM, Simon Sapin wrote: An important aspect is that atoms with different static sets are different Rust types. Just to check that I understand correctly... Are element names atoms? Which static set do they come from? Presumably the html5ever one? When parsing CSS selectors,

Re: [dev-servo] NCSU Team introduction

2016-11-03 Thread ysun34
Hi Josh, Do we need to write test cases for what we have done so far? If yes, do we need to run auto test cases (e.g. unit test) or a simple HTML test page is enough? Since right now we only did initial steps, we have no idea how to test it. Can you give us some instructions? _

Re: [dev-servo] string-cache (string interning) is now generic

2016-11-03 Thread Simon Sapin
On 03/11/16 21:02, Boris Zbarsky wrote: On 11/3/16 3:17 PM, Simon Sapin wrote: An important aspect is that atoms with different static sets are different Rust types. Just to check that I understand correctly... Are element names atoms? Which static set do they come from? Presumably the html5

Re: [dev-servo] string-cache (string interning) is now generic

2016-11-03 Thread Bobby Holley
On Thu, Nov 3, 2016 at 1:30 PM, Simon Sapin wrote: > On 03/11/16 21:02, Boris Zbarsky wrote: > >> On 11/3/16 3:17 PM, Simon Sapin wrote: >> >>> An important aspect is that atoms with different static sets are >>> different Rust types. >>> >> >> Just to check that I understand correctly... >> >> A

Re: [dev-servo] NCSU Team introduction

2016-11-03 Thread Josh Matthews
On 2016-11-03 4:05 PM, ysu...@ncsu.edu wrote: Hi Josh, Do we need to write test cases for what we have done so far? If yes, do we need to run auto test cases (e.g. unit test) or a simple HTML test page is enough? Since right now we only did initial steps, we have no idea how to test it. Can y

Re: [dev-servo] string-cache (string interning) is now generic

2016-11-03 Thread Boris Zbarsky
On 11/3/16 4:30 PM, Simon Sapin wrote: Servo defines: type AttrValue = std::string::String; type Identifier = servo_atoms::Atom; type ClassName = servo_atoms::Atom; type LocalName = html5ever_atoms::LocalName; type NamespacePrefix = html5ever_atoms::Prefix; Ah, perfect. Th