Last Comment Bug 739510 - Speed up construction of char * properties
: Speed up construction of char * properties
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Gecko Profiler (show other bugs)
: unspecified
: x86 Mac OS X
: -- normal (vote)
: mozilla14
Assigned To: Jeff Muizelaar [:jrmuizel]
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-26 20:26 PDT by Jeff Muizelaar [:jrmuizel]
Modified: 2012-04-19 02:28 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Speed up DefineProperty for const char * (1.01 KB, patch)
2012-03-26 20:26 PDT, Jeff Muizelaar [:jrmuizel]
ehsan: review+
Details | Diff | Splinter Review

Description Jeff Muizelaar [:jrmuizel] 2012-03-26 20:26:22 PDT
This eliminates two additional copies: NS_ConvertASCIItoUTF16 and PromiseFlatString by constructing the JSString directly. It is also designed
so that literal strings will have their strlen computed at compile time.
Comment 1 Jeff Muizelaar [:jrmuizel] 2012-03-26 20:26:59 PDT
Created attachment 609594 [details] [diff] [review]
Speed up DefineProperty for const char *
Comment 2 :Ehsan Akhgari 2012-03-26 21:55:03 PDT
Comment on attachment 609594 [details] [diff] [review]
Speed up DefineProperty for const char *

Review of attachment 609594 [details] [diff] [review]:
-----------------------------------------------------------------

::: tools/profiler/JSObjectBuilder.h
@@ +93,5 @@
> +    if (!string)
> +      mOk = JS_FALSE;
> +
> +    if (!mOk)
> +      return;

if (!string) {
  mOk = JS_FALSE;
  return;
}
Comment 3 Jeff Muizelaar [:jrmuizel] 2012-04-16 17:35:05 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/5130ac1fa079
Comment 4 Marco Bonardo [::mak] 2012-04-17 07:47:18 PDT
https://hg.mozilla.org/mozilla-central/rev/5130ac1fa079
Comment 5 :Ms2ger 2012-04-19 02:28:36 PDT
(In reply to Jeff Muizelaar [:jrmuizel] from comment #0)
> It is also designed
> so that literal strings will have their strlen computed at compile time.

How so?

Note You need to log in before you can comment on or make changes to this bug.