Closed Bug 515969 Opened 16 years ago Closed 4 years ago

Optimize UTF8 decoding in UTF8Utils

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: alfredkayser, Unassigned)

References

Details

(Keywords: perf)

Attachments

(1 file)

Optimize UTF8 decoding in UTF8Utils, by: 1. Add a simple fastpath for ASCII. 2. Inline CalcState. 3. Inline AddByte. Ad 1. Very simple check for ascii bit, and then skip the call to UTF8CharEnumerator::NextChar with all the overhead of params and such. Ad 2. Compiler doesn't inline, even if asked very politely, but manual inline allows to remove a lot of param pushing/popping. Ad 3. AddByte is essentially a one-line, but compiler also refuses to inline this one. Even with these 'inline's, the overall object code is smaller: Before: 830138 xpcomio_s.lib 3758212 build/xpcom_core.lib After: 829458 xpcomio_s.lib 3757032 build/xpcom_core.lib So, overall less and faster code, especially for converting plain ascii to UTF16. See also bug 514140 where need for UTF8 to UTF16 conversion is explained.

The bug assignee didn't login in Bugzilla in the last 7 months.
:nika, could you have a look please?
For more information, please visit auto_nag documentation.

Assignee: alfredkayser → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(nika)

We have completely replaced our UTF8->UTF16 infrastructure since this bug was filed.

Status: NEW → RESOLVED
Closed: 4 years ago
Flags: needinfo?(nika)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: