On Nov 7, 2009, at 3:10 PM, Erik Corry wrote:

> V8 strings get moved by the garbage collector so it's probably
> unrealistic to access the internal strings externally.

Yes. Using V8 to back a StringImpl would require doing something about  
the API call that returns a direct pointer to the characters. (I have  
a couple of ideas.)

> On the other
> hand V8 supports strings backed by an external immutable utf16 or
> ASCii character buffer (no utf-8!).  This is already heavily used in
> the binding layer.

The problem with this is that V8 still allocates the string first, and  
then WebCore makes a copy. Even though V8 points to the WebCore string  
afterwards, the memory for the original V8 string is still in the V8  
heap until the next GC. So this has an effect on footprint. In  
addition, the time to copy the strings is definitely a hot spot in the  
Dromaeo DOM benchmarks.

> While utf8 can be useful for interchange and storage it is a major
> pain for immutable strings (how to get the nth character?)  and no use
> at all for mutable string buffers.

Agreed. ISO-8859-1 (aka CP1252) would be a saner choice.

—Jens
--~--~---------~--~----~------------~-------~--~----~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to