This post has moved to my new location, philosopherdeveloper.com:
http://philosopherdeveloper.com/posts/magical-optimization-of-the-%2B%3D-operator-with-strings.html
This post has moved to my new location, philosopherdeveloper.com:
http://philosopherdeveloper.com/posts/magical-optimization-of-the-%2B%3D-operator-with-strings.html
Chrome (or at least parts of it) is open source. Couldn’t you just look at the source code? Granted, looking for something like this in a big, unknown codebase will most likely take some time, but it still may be worth it.
No, that’s definitely true. I guess my intention originally wasn’t really to know how Chrome did it; rather, I viewed it as an interesting challenge to try myself, and only afterwards looking back do I wonder, “How *did* they do it, actually?” That said, you’re right that it’s a really big code base; so finding the += optimization would probably be a pretty significant research endeavor in its own right. But that’s a good idea for a follow-up post!