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

2013-06-07 Thread Simon Fraser
Based on the fact that AtomicString is really a singleton string, I’d like to suggest a new name for this class: Stringleton Simon On Jun 3, 2013, at 3:37 PM, Brendan Long s...@brendanlong.com wrote: On 06/01/2013 10:09 PM, Glenn Adams wrote: But the name did throw me, since I asked myself

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

2013-06-07 Thread Geoffrey Garen
The Lisp name for this concept is Symbol. The C/C++/JavaScript name is Identifier. Geoff On Jun 7, 2013, at 6:18 AM, Simon Fraser simon.fra...@apple.com wrote: Based on the fact that AtomicString is really a singleton string, I’d like to suggest a new name for this class: Stringleton

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

2013-06-07 Thread Filip Pizlo
Sent from my PDP-11 On Jun 7, 2013, at 6:18 AM, Simon Fraser simon.fra...@apple.com wrote: Based on the fact that AtomicString is really a singleton string, I’d like to suggest a new name for this class: Stringleton +1 Simon On Jun 3, 2013, at 3:37 PM, Brendan Long

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

2013-06-03 Thread Maciej Stachowiak
On Jun 2, 2013, at 3:49 AM, Glenn Adams gl...@skynav.com wrote: On Sun, Jun 2, 2013 at 2:48 AM, Maciej Stachowiak m...@apple.com wrote: On Jun 1, 2013, at 8:54 PM, Glenn Adams gl...@skynav.com wrote: You guys obviously never wrote any Lisp code. Um, why do you think I suggested

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

2013-06-03 Thread Brendan Long
On 06/01/2013 10:09 PM, Glenn Adams wrote: But the name did throw me, since I asked myself what makes this more 'atomic' than String, synchronicity wise? I'm sure I'm not the only one who wondered about this. Before asking this question I had assumed AtomicString was an atomic type

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

2013-06-02 Thread Maciej Stachowiak
On Jun 1, 2013, at 8:54 PM, Glenn Adams gl...@skynav.com wrote: You guys obviously never wrote any Lisp code. Um, why do you think I suggested Symbol? On Jun 1, 2013, at 9:09 PM, Glenn Adams gl...@skynav.com wrote: Seriously, if Atomic isn't jargon, Intern isn't either. Both are jargon.

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

2013-06-02 Thread Glenn Adams
On Sun, Jun 2, 2013 at 2:48 AM, Maciej Stachowiak m...@apple.com wrote: On Jun 1, 2013, at 8:54 PM, Glenn Adams gl...@skynav.com wrote: You guys obviously never wrote any Lisp code. Um, why do you think I suggested Symbol? On Jun 1, 2013, at 9:09 PM, Glenn Adams gl...@skynav.com

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

2013-06-01 Thread Darin Adler
On May 31, 2013, at 8:01 PM, Glenn Adams gl...@skynav.com wrote: One thing that always threw me was the term Atomic in the class name. I wonder if the term InternedString would make it usage more apparent. I personally love the name AtomicString (the string of tomorrow) and have been using

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

2013-06-01 Thread Maciej Stachowiak
On Jun 1, 2013, at 3:58 PM, Darin Adler da...@apple.com wrote: On May 31, 2013, at 8:01 PM, Glenn Adams gl...@skynav.com wrote: One thing that always threw me was the term Atomic in the class name. I wonder if the term InternedString would make it usage more apparent. I personally love

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

2013-06-01 Thread Ryosuke Niwa
On Sat, Jun 1, 2013 at 4:45 PM, Maciej Stachowiak m...@apple.com wrote: On Jun 1, 2013, at 3:58 PM, Darin Adler da...@apple.com wrote: On May 31, 2013, at 8:01 PM, Glenn Adams gl...@skynav.com wrote: One thing that always threw me was the term Atomic in the class name. I wonder if the term

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

2013-06-01 Thread Glenn Adams
You guys obviously never wrote any Lisp code. http://books.google.com/books?id=FYoOIWuoXUIClpg=PA267ots=ioaahFTKT0dq=intern%20special%20form%20maclisppg=PA266#v=onepageq=intern%20special%20form%20maclispf=false On Sat, Jun 1, 2013 at 6:01 PM, Ryosuke Niwa rn...@webkit.org wrote: On Sat, Jun

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

2013-06-01 Thread Darin Adler
On Jun 1, 2013, at 8:54 PM, Glenn Adams gl...@skynav.com wrote: You guys obviously never wrote any Lisp code. Lets not play this game. When I met Maciej he was the maintainer of one of the most popular Scheme implementations, if I remember correctly. -- Darin

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

2013-06-01 Thread Glenn Adams
On Sat, Jun 1, 2013 at 9:56 PM, Darin Adler da...@apple.com wrote: On Jun 1, 2013, at 8:54 PM, Glenn Adams gl...@skynav.com wrote: You guys obviously never wrote any Lisp code. Lets not play this game. When I met Maciej he was the maintainer of one of the most popular Scheme

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

2013-06-01 Thread Simon Fraser
Gecko simply calls these “Atoms”. StringAtom? AtomString? Simon On Jun 1, 2013, at 9:09 PM, Glenn Adams gl...@skynav.com wrote: On Sat, Jun 1, 2013 at 9:56 PM, Darin Adler da...@apple.com wrote: On Jun 1, 2013, at 8:54 PM, Glenn Adams gl...@skynav.com wrote: You guys obviously never

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

2013-06-01 Thread Ryosuke Niwa
On Sat, Jun 1, 2013 at 9:09 PM, Glenn Adams gl...@skynav.com wrote: On Sat, Jun 1, 2013 at 9:56 PM, Darin Adler da...@apple.com wrote: On Jun 1, 2013, at 8:54 PM, Glenn Adams gl...@skynav.com wrote: You guys obviously never wrote any Lisp code. Lets not play this game. When I met Maciej

[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