Closed Bug 81433 Opened 23 years ago Closed 15 years ago

get rid of the iterator forms of |CopyUnicodeTo| and |AppendUnicodeTo|

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: scc, Assigned: jag+mozilla)

Details

...see bug #74178.  These functions are not needed and are better accomplished
with simple assignment.
Status: NEW → ASSIGNED
If they are going away, I want the Substring variant to be as fast as the
Copy... methods. I was choosing between the two and did some measurements in bug
83945 with the following result:

>
> CopyUnicodeTo: 6,32 ms
> 
> SubString : 5,76 ms (assignment) + 3,98 ms (creation of a nsDependentSubstring)
>

You can look at the patch in the bug to see if I do anything wrong, but I don't
want to increase the time needed by 50% without a clear reason.
I have something special for you :-)  |Substring| over strings whose static type
is single fragment will produce smaller faster substrings that are only a pair
of pointers.  It will end up being faster than either the old iterator method or
the old substring method in this cases.
In the example above, the iterators were iterators on an nsString and the target 
string for the assignment was an nsString. Can it be any better/flatter?
An |nsString| is single fragment, and so will automatically benefit from this
change when I check it in.  I'll link to the bug for this as soon as I have a
patch and file the bug.
So after you implemented that part, assignment of a substring would only be
assigning a couple of pointers? Nice!
giving up ancient string bugs to the new string owner.  jag, you'll want to sort
through these and see which ones still apply and go with or against the
direction in which you intend strings evolve
Assignee: scc → jaggernaut
Status: ASSIGNED → NEW
QA Contact: scc → string
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → INCOMPLETE
Component: String → XPCOM
You need to log in before you can comment on or make changes to this bug.