Mozilla 2/Strings/Dynamic Analysis: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
Line 26: Line 26:
* Dynamic analysis: autostring buffer-copy counts (are autostrings worthwhile)?  
* Dynamic analysis: autostring buffer-copy counts (are autostrings worthwhile)?  


Procedure: todo
Procedure: todo [dmandelin] I think here you are asking for the fraction of nsAutoStrings that end up having to allocate space on the heap after the string grows. Is that right?

Revision as of 00:47, 15 February 2008

<< back to Mozilla 2/Strings

The cost/benefit of UTF8

Question: If we moved from our current UCS2/UTF16 storage for nsAString to UTF8, what would the impact be on memory usage?

Procedure:

Instrument nsStringBuffer with a large linked-list (with locking and all that good stuff). Run the instrumented browser and collect data about all nsStringBuffers which hold PRUnichar data:

  • What is the size of the buffer
  • What would the size of the buffer be in UTF8?
  • Is the buffer pure-ASCII?

Conversion counts

Question: how much do we currently convert between UTF8 and UTF16?

Procedure: Instrument the number of calls to ConvertUTF8toUTF16 and ConvertUTF16toUTF8.

Bonus points: group and identify common callstacks

Autostring value

  • Dynamic analysis: autostring buffer-copy counts (are autostrings worthwhile)?

Procedure: todo [dmandelin] I think here you are asking for the fraction of nsAutoStrings that end up having to allocate space on the heap after the string grows. Is that right?