Comment #2 on issue 455 by funisher: increased String.concat() performance  
(patch)
http://code.google.com/p/v8/issues/detail?id=455

yea, like I said in the other, I'll use the code review from now on... I  
didn't know
of it.

there are still two inefficiencies that can possibly be removed here.  
first, the
concat function is only a member of the String object, so there should be  
no reason
to call ToString(this) on it as it's always a string. can anyone verify  
that there's
no way to ever apply the concat function to another object?

second, because we're 100% sure that we're calling ToString on every  
argument passed,
there's no reason to use the CONVERT_CHECKED macro, because obj->IsString()  
will
never return false, we could directly just put:

String* str1 = String::cast(args[0]);
String* str2 = String::cast(args[1]);
return Heap::AllocateConsString(str1, str2);

I did not however want to be *that* aggressive on my optimizations :)

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to