Closed Bug 115387 Opened 23 years ago Closed 23 years ago

avoid using MIME_ConvertCharset

Categories

(MailNews Core :: Internationalization, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
mozilla0.9.8

People

(Reporter: nhottanscp, Assigned: nhottanscp)

References

Details

(Keywords: perf)

Attachments

(2 files, 1 obsolete file)

This mainly affects non ASCII headers. MIME_ConvertCharset used to be used by message body conversion but now converters are cached in MIME object and this is not used. Currently, the main user is MIME decoder which needs conversion from MIME charset to UTF-8. This can be done by i18n util function and NS_ConvertUCS2toUTF8. Here is a data using Quantify. MIME decoder intl_decode_mime_part2_str() takes less time (about 57%) when not calling MIME_ConvertCharset(). intl_decode_mime_part2_str, calling MIME_ConvertCharset 40 36.72 21579.74 0.00 0.00 0.92 0.69 1.31 intl_decode_mime_part2_str, not calling MIME_ConvertCharset 40 37.60 12334.15 0.00 0.00 0.94 0.71 1.33
Forgot the labels of the last data. that is, # of callls Function time F+D time F time F+D time (% of Focus) Avg F time Min F time Max F time
Blocks: 115288
Status: NEW → ASSIGNED
Keywords: perf
Target Milestone: --- → mozilla0.9.8
Attachment #61826 - Attachment is obsolete: true
Comment on attachment 62053 [details] [diff] [review] Removed MIME_ConvertCharset and related code. Looks good. R=ducarroz
Attachment #62053 - Flags: review+
Comment on attachment 62053 [details] [diff] [review] Removed MIME_ConvertCharset and related code. sr=sspitzer
checked in (on 12/18)
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
The following mimemoz2.cpp change commited in this bug removes the "res =" in the "else" branch, which would cause *uninitialized value* to be compared with 0 in the case of NULL encoder or decoder... @@ -764,16 +764,10 @@ PRInt32 res; char *convertedString = NULL; PRInt32 convertedStringLen; - if (!input_autodetect && encoder && decoder) + if (encoder && decoder) { res = ConvertUsingEncoderAndDecoder(input_line, input_length, encoder, decoder, &convertedString); convertedStringLen = (convertedString) ? nsCRT::strlen(convertedString) : 0; - } - else - { - // Now do conversion to UTF-8 for output - res = MIME_ConvertCharset(input_autodetect, input_charset, "UTF-8", input_line, input_length, - &convertedString, &convertedStringLen, NULL); } if (res != 0) {
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment on attachment 64205 [details] [diff] [review] Changed mime_convert_charset to initialized the result value. R=ducarroz
Comment on attachment 64205 [details] [diff] [review] Changed mime_convert_charset to initialized the result value. sr=sspitzer
Attachment #64205 - Flags: superreview+
checked in
Status: REOPENED → RESOLVED
Closed: 23 years ago23 years ago
Resolution: --- → FIXED
Naoki, could you help verifying this? Thanks a lot.
QA Contact: ji → nhotta
verified by LXR
Status: RESOLVED → VERIFIED
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: