Mozilla 2/Strings/Dynamic Analysis

From MozillaWiki
Jump to: navigation, search

<< 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] Does this mean (a) the fraction of nsAutoStrings that grow big enough to get moved to the heap, (b) the fraction of nsAutoStrings that end up being used to initialize a standard heap string, or both?