Re: [webkit-dev] Slow idioms with WTF::String

2011-07-18 Thread Geoffrey Garen
How about using RopeImpl as JSString does to boost operator+=? The solutions Darin suggested are faster and more memory efficient than RopeImpl. RopeImpl is a good solution when you can't control the string idioms used by the programmer. Hopefully we don't have this problem in WebKit! Geoff

[webkit-dev] Slow idioms with WTF::String

2011-07-12 Thread Darin Adler
Hi folks. The key to fast use of WTF::String is to avoid creating temporary WTF::StringImpl objects or temporary copies of string data. With the latest enhancements to WTF::String, here are the preferred fast ways to build a new string: - A single expression with the + operator and

Re: [webkit-dev] Slow idioms with WTF::String

2011-07-12 Thread Darin Fisher
On Tue, Jul 12, 2011 at 10:25 AM, Darin Adler da...@apple.com wrote: Hi folks. The key to fast use of WTF::String is to avoid creating temporary WTF::StringImpl objects or temporary copies of string data. With the latest enhancements to WTF::String, here are the preferred fast ways to

Re: [webkit-dev] Slow idioms with WTF::String

2011-07-12 Thread Ryosuke Niwa
Excited to see WTF::String getting easier to use efficiently! On Tue, Jul 12, 2011 at 10:25 AM, Darin Adler da...@apple.com wrote: I would not be surprised if at least some of these will show up immediately with the right kind of performance test. The CSS parsing and serialization functions

Re: [webkit-dev] Slow idioms with WTF::String

2011-07-12 Thread Darin Adler
On Jul 12, 2011, at 10:31 AM, Darin Fisher wrote: On Tue, Jul 12, 2011 at 10:25 AM, Darin Adler da...@apple.com wrote: I would not be surprised if at least some of these will show up immediately with the right kind of performance test. The CSS parsing and serialization functions seem

Re: [webkit-dev] Slow idioms with WTF::String

2011-07-12 Thread Yong Li
How about using RopeImpl as JSString does to boost operator+=? Not sure how bad it affects simple strings. Then another idea is to introduce a LargeString implemented with ropes for special purposes like parsers. Another slow case is converting a const C string to WTF::String every time. For

Re: [webkit-dev] Slow idioms with WTF::String

2011-07-12 Thread Rob Buis
Hi Yong, On 12 July 2011 18:10, Yong Li yong.li.web...@gmail.com wrote: Another slow case is converting a const C string to WTF::String every time. For example,    return (m_httpHeaderFields.contains(If-Match) ||            m_httpHeaderFields.contains(If-Modified-Since) ||