Re: [webkit-dev] String::operator+= considered harmful

2012-09-07 Thread Anders Carlsson
On Sep 4, 2012, at 5:52 PM, Benjamin Poulain benja...@webkit.org wrote: On Tue, Sep 4, 2012 at 4:22 PM, Adam Barth aba...@webkit.org wrote: Removing operator+= will likely require changes to a number of port-specific files. I'll do my best to remove these, but I might need some help from

Re: [webkit-dev] String::operator+= considered harmful

2012-09-05 Thread Patrick Gansterer
On Tue, 04 Sep 2012 22:26:52 -0700, Adam Barth wrote: On Tue, Sep 4, 2012 at 10:06 PM, Christophe Dumez christophe.du...@intel.com wrote: On Sep 5, 2012, at 2:22 AM, Adam Barth aba...@webkit.org wrote: Removing operator+= will likely require changes to a number of port-specific files. I'll do

Re: [webkit-dev] String::operator+= considered harmful

2012-09-05 Thread Adam Barth
On Wed, Sep 5, 2012 at 3:23 AM, Patrick Gansterer par...@paroga.com wrote: On Tue, 04 Sep 2012 22:26:52 -0700, Adam Barth wrote: On Tue, Sep 4, 2012 at 10:06 PM, Christophe Dumez christophe.du...@intel.com wrote: On Sep 5, 2012, at 2:22 AM, Adam Barth aba...@webkit.org wrote: Removing

Re: [webkit-dev] String::operator+= considered harmful

2012-09-05 Thread Lauro Moura
On Wed, Sep 5, 2012 at 12:44 PM, Adam Barth aba...@webkit.org wrote: On Wed, Sep 5, 2012 at 3:23 AM, Patrick Gansterer par...@paroga.com wrote: On Tue, 04 Sep 2012 22:26:52 -0700, Adam Barth wrote: On Tue, Sep 4, 2012 at 10:06 PM, Christophe Dumez christophe.du...@intel.com wrote: On Sep 5,

Re: [webkit-dev] String::operator+= considered harmful

2012-09-04 Thread Dirk Schulze
I thought we had efforts to make String::operator+= use StringBuilder somehow? I can remember that we had a discussion on webkit-dev and definitely on bugzilla about improving String::operator+= instead of replacing it with StringBuilder. Greetings, Dirk On Sep 4, 2012, at 4:22 PM, Adam Barth

Re: [webkit-dev] String::operator+= considered harmful

2012-09-04 Thread Adam Barth
Do you have a proposal for how that would work and/or a link to the previous discussion? Adam On Tue, Sep 4, 2012 at 4:27 PM, Dirk Schulze dschu...@adobe.com wrote: I thought we had efforts to make String::operator+= use StringBuilder somehow? I can remember that we had a discussion on

Re: [webkit-dev] String::operator+= considered harmful

2012-09-04 Thread Dirk Schulze
With a short search in the logs I found optimizations for at least operator+, but didn't search further: http://trac.webkit.org/changeset/86330 https://bugs.webkit.org/show_bug.cgi?id=58420 Greetings, Dirk On Sep 4, 2012, at 4:31 PM, Adam Barth aba...@webkit.org wrote: Do you have a

Re: [webkit-dev] String::operator+= considered harmful

2012-09-04 Thread Adam Barth
Ah, you're think of operator+, which is now quite efficient. This thread is about operator+=, which is sadly slower than molasses. Adam On Tue, Sep 4, 2012 at 4:38 PM, Dirk Schulze dschu...@adobe.com wrote: With a short search in the logs I found optimizations for at least operator+, but

Re: [webkit-dev] String::operator+= considered harmful

2012-09-04 Thread Dirk Schulze
Yes, looks like the efforts didn't went further. Anyway, is there no possibility to improve operator+= further? It is very likely that even future code will land with this operator instead of StringBuilder. I think it is better to try to change the operator (if possible) instead of people.

Re: [webkit-dev] String::operator+= considered harmful

2012-09-04 Thread Maciej Stachowiak
operator+ is now efficient (potentially more so than using a StringBuilder if you can do it all in one statement). operator+= still sucks, and I don't think we came up with an obvious way to get good performance with the same syntax. One possibility: we could add operator+=(String) to

Re: [webkit-dev] String::operator+= considered harmful

2012-09-04 Thread Maciej Stachowiak
On Sep 4, 2012, at 4:44 PM, Dirk Schulze dschu...@adobe.com wrote: Yes, looks like the efforts didn't went further. Anyway, is there no possibility to improve operator+= further? It is very likely that even future code will land with this operator instead of StringBuilder. I think it is

Re: [webkit-dev] String::operator+= considered harmful

2012-09-04 Thread Mike Lawther
On 5 September 2012 09:44, Dirk Schulze dschu...@adobe.com wrote: It is very likely that even future code will land with this operator instead of StringBuilder. Not if Adam removes the operator as he proposed earlier :) If operator+= cannot be made sufficiently efficient, we could always

Re: [webkit-dev] String::operator+= considered harmful

2012-09-04 Thread Maciej Stachowiak
On Sep 4, 2012, at 5:16 PM, Mike Lawther mikelawt...@chromium.org wrote: On 5 September 2012 09:44, Dirk Schulze dschu...@adobe.com wrote: It is very likely that even future code will land with this operator instead of StringBuilder. Not if Adam removes the operator as he proposed

Re: [webkit-dev] String::operator+= considered harmful

2012-09-04 Thread Mike Lawther
If operator+= cannot be made sufficiently efficient, we could always leave the operator there, but have it ASSERT with a message saying to use StringBuilder. Please not this. Failing at compile time is much better than failing at runtime in debug builds only. I was only half serious,

Re: [webkit-dev] String::operator+= considered harmful

2012-09-04 Thread Benjamin Poulain
On Tue, Sep 4, 2012 at 4:22 PM, Adam Barth aba...@webkit.org wrote: Removing operator+= will likely require changes to a number of port-specific files. I'll do my best to remove these, but I might need some help from maintainers of individual ports. If you're interested in helping out,

Re: [webkit-dev] String::operator+= considered harmful

2012-09-04 Thread Christophe Dumez
On Sep 5, 2012, at 2:22 AM, Adam Barth aba...@webkit.org wrote: Removing operator+= will likely require changes to a number of port-specific files. I'll do my best to remove these, but I might need some help from maintainers of individual ports. If you're interested in helping out, please

Re: [webkit-dev] String::operator+= considered harmful

2012-09-04 Thread Adam Barth
On Tue, Sep 4, 2012 at 10:06 PM, Christophe Dumez christophe.du...@intel.com wrote: On Sep 5, 2012, at 2:22 AM, Adam Barth aba...@webkit.org wrote: Removing operator+= will likely require changes to a number of port-specific files. I'll do my best to remove these, but I might need some help