[webkit-dev] When should I use AtomicString vs String?

2013-05-31 Thread Brendan Long
I hope this isn't a stupid question, but I can't find any references to what the difference between AtomicString and String is. It looks like AtomicString is generally preferred, but I don't know why. Can someone fill me in on this? Is there any refences for the classes in WTF? signature.asc

Re: [webkit-dev] When should I use AtomicString vs String?

2013-05-31 Thread Daker Pinheiro
It is faster to compare and hash AtomicString than regular Strings. On Fri, May 31, 2013 at 5:57 PM, Brendan Long s...@brendanlong.com wrote: I hope this isn't a stupid question, but I can't find any references to what the difference between AtomicString and String is. It looks like

Re: [webkit-dev] When should I use AtomicString vs String?

2013-05-31 Thread Yoav Weiss
Are there any advantages to String over AtomicString? On Fri, May 31, 2013 at 11:14 PM, Daker Pinheiro daker.pinhe...@openbossa.org wrote: It is faster to compare and hash AtomicString than regular Strings. On Fri, May 31, 2013 at 5:57 PM, Brendan Long s...@brendanlong.comwrote: I hope

Re: [webkit-dev] When should I use AtomicString vs String?

2013-05-31 Thread Brendan Long
So should I just never use String and always use AtomicString? On 05/31/2013 03:14 PM, Daker Pinheiro wrote: It is faster to compare and hash AtomicString than regular Strings. On Fri, May 31, 2013 at 5:57 PM, Brendan Long s...@brendanlong.com mailto:s...@brendanlong.com wrote: I hope

Re: [webkit-dev] When should I use AtomicString vs String?

2013-05-31 Thread Darin Adler
On May 31, 2013, at 1:57 PM, Brendan Long s...@brendanlong.com wrote: I hope this isn't a stupid question, but I can't find any references to what the difference between AtomicString and String is. WTF::AtomicString is a class that has four differences from the normal WTF::String class: 1)

Re: [webkit-dev] When should I use AtomicString vs String?

2013-05-31 Thread Adam Barth
On Fri, May 31, 2013 at 3:18 PM, Darin Adler da...@apple.com wrote: On May 31, 2013, at 1:57 PM, Brendan Long s...@brendanlong.com wrote: I hope this isn't a stupid question, but I can't find any references to what the difference between AtomicString and String is. WTF::AtomicString is a

Re: [webkit-dev] When should I use AtomicString vs String?

2013-05-31 Thread Darin Adler
On May 31, 2013, at 3:27 PM, Adam Barth aba...@webkit.org wrote: I believe we store a bit on StringImpl that makes conversion from String and StringImpl to AtomicString fast if the underlying StringImpl is already in the AtomicStringTable. Good point. Converting back to an atomic string

Re: [webkit-dev] When should I use AtomicString vs String?

2013-05-31 Thread Ryosuke Niwa
We shouldn't use AtomicString if the string we're about to create doesn't get shared across multiple AtomicStrings. For example, if we had used AtomicString for the strings inside Text nodes, then we may end up filling up the atomic string table with all these really long strings that don't

Re: [webkit-dev] When should I use AtomicString vs String?

2013-05-31 Thread Rafael Brandao
This thread contains really useful information, so I've created a new topic on https://trac.webkit.org/wiki/EfficientStrings and pointed to here. Best regards, Rafael On Fri, May 31, 2013 at 8:32 PM, Ryosuke Niwa rn...@webkit.org wrote: We shouldn't use AtomicString if the string we're about

Re: [webkit-dev] When should I use AtomicString vs String?

2013-05-31 Thread Glenn Adams
On Fri, May 31, 2013 at 6:14 PM, Rafael Brandao rafael.l...@openbossa.orgwrote: This thread contains really useful information, so I've created a new topic on https://trac.webkit.org/wiki/EfficientStrings and pointed to here. One thing that always threw me was the term Atomic in the class

Re: [webkit-dev] When should I use AtomicString vs String?

2013-05-31 Thread Ryosuke Niwa
Great! Maybe we even want to add it to http://www.webkit.org/coding/technical-articles.html after converting it to a web page? - R. Niwa On Fri, May 31, 2013 at 5:14 PM, Rafael Brandao rafael.l...@openbossa.orgwrote: This thread contains really useful information, so I've created a new

Re: [webkit-dev] When should I use AtomicString vs String?

2013-05-31 Thread Myles C. Maxfield
+1 :-) On Friday, May 31, 2013, Glenn Adams wrote: On Fri, May 31, 2013 at 6:14 PM, Rafael Brandao rafael.l...@openbossa.orgjavascript:_e({}, 'cvml', 'rafael.l...@openbossa.org'); wrote: This thread contains really useful information, so I've created a new topic on