Excessive calls to IsDBCSLeadByte from net_CoalesceDirs?

RESOLVED FIXED in mozilla1.8beta1

Status

()

Core
Networking
--
minor
RESOLVED FIXED
13 years ago
13 years ago

People

(Reporter: Darin Fisher, Assigned: Darin Fisher)

Tracking

({perf})

Trunk
mozilla1.8beta1
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

3.44 KB, patch
Andreas Otte
: review+
Brian Ryner (not reading)
: superreview+
Details | Diff | Splinter Review
(Assignee)

Description

13 years ago
Excessive calls to IsDBCSLeadByte from net_CoalesceDirs?

It looks like all callers of net_CoalesceDirs may be passing UTF-8 strings,
which means that the IsDBCSLeadByte calls made by that function may be unnecessary.

bryner has found that these calls show up on Quantify results indicating that
there might be a significant performance win if we can remove them.

I suspect that IsDBCSLeadByte might be leftover from when we used to pass
platform specific multi-byte strings through nsIURI.

we need to verify that we are indeed only ever passing UTF-8 (or ASCII) to
net_CoalesceDirs, and then remove it.

NOTE: if we ever unescape strings before passing them to this function, then my
assertion would be false.
(Assignee)

Updated

13 years ago
Severity: normal → minor
Keywords: helpwanted, perf
Target Milestone: --- → Future

Comment 1

13 years ago
I agree, this is most likely a leftover from old times. However we also most
likely feed already unescaped strings to net_CoalesceDirs, some stuff in
malinews comes to mind. That code might be broken because of that, but I once
tried to fix some of that and broke the rules-stuff in mailnews in the process
because storage of the rules depended on those broken escape-unescape sequences.

Bottom line: Those instances will be hard to find and even harder to fix ...
(Assignee)

Comment 2

13 years ago
Created attachment 164485 [details] [diff] [review]
v1 patch
(Assignee)

Comment 3

13 years ago
In nsStandardURL::Resolve & BuildNormalizedSpec, calling net_CoalesceDirs is one
of the very last things that we do before returning the result to the caller. 
In fact, in those cases the buffer is already UTF-8 (or ASCII), so I don't think
we can safely remove this IsDBCSLeadByte check.
Status: NEW → ASSIGNED
Target Milestone: Future → mozilla1.8beta
(Assignee)

Updated

13 years ago
Attachment #164485 - Flags: superreview?(bryner)
Attachment #164485 - Flags: review?(andreas.otte)
(Assignee)

Comment 4

13 years ago
> so I don't think we can safely remove this IsDBCSLeadByte check.

I meant: "so I _do_ think we can ..."

Sorry about that! ;-)
Attachment #164485 - Flags: superreview?(bryner) → superreview+

Updated

13 years ago
Attachment #164485 - Flags: review?(andreas.otte) → review+
Keywords: helpwanted
(Assignee)

Comment 5

13 years ago
fixed-on-trunk
Status: ASSIGNED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.