Closed
Bug 608914
Opened 13 years ago
Closed 13 years ago
Move AppendFloat/AppendInt up to nsAString
Categories
(Core :: XPCOM, defect, P1)
Tracking
()
RESOLVED
FIXED
mozilla2.0b8
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
(Blocks 1 open bug)
Details
(Keywords: dev-doc-needed)
Attachments
(3 files)
13.13 KB,
patch
|
benjamin
:
review+
|
Details | Diff | Splinter Review |
7.24 KB,
patch
|
dbaron
:
review+
|
Details | Diff | Splinter Review |
19.79 KB,
patch
|
benjamin
:
approval2.0+
|
Details | Diff | Splinter Review |
Unless there's a _really_ good reason to not have them there, we should do this. Currently we end up with silly temporary strings and string copies, even though both caller and callee have nsStrings. The other option is to move perf-sensitive stuff that might need to do those away from XPCOM interfaces that return strings, but that's a pretty big project.
![]() |
Assignee | |
Comment 1•13 years ago
|
||
![]() |
Assignee | |
Comment 2•13 years ago
|
||
![]() |
Assignee | |
Updated•13 years ago
|
Attachment #487810 -
Flags: review?(dbaron)
![]() |
Assignee | |
Updated•13 years ago
|
Attachment #487809 -
Flags: review?(benjamin)
![]() |
Assignee | |
Updated•13 years ago
|
Assignee: nobody → bzbarsky
Priority: -- → P1
Whiteboard: [need review]
Comment 3•13 years ago
|
||
Comment on attachment 487809 [details] [diff] [review] part 1. Remove the nsString overloads of AppendInt and move AppendFloat up to nsAString. I presume we have tests covering this stuff already?
Attachment #487809 -
Flags: review?(benjamin) → review+
![]() |
Assignee | |
Comment 4•13 years ago
|
||
We have TestStrings.cpp, but that's only compiled in non-libxul builds, of course...
Comment 5•13 years ago
|
||
Comment on attachment 487810 [details] [diff] [review] part 2. Get rid of some temporary strings now that we can AppendFloat to an nsAString. r=dbaron
Attachment #487810 -
Flags: review?(dbaron) → review+
![]() |
Assignee | |
Comment 6•13 years ago
|
||
Should be a pretty safe perf win.
Attachment #493896 -
Flags: approval2.0?
![]() |
Assignee | |
Updated•13 years ago
|
Whiteboard: [need review] → [need approval]
Updated•13 years ago
|
Attachment #493896 -
Flags: approval2.0? → approval2.0+
![]() |
Assignee | |
Updated•13 years ago
|
Whiteboard: [need approval] → [need landing]
Comment 7•13 years ago
|
||
Comment on attachment 487810 [details] [diff] [review] part 2. Get rid of some temporary strings now that we can AppendFloat to an nsAString. >- tmpStr.AppendInt(NS_GET_R(color), 10); >- tmpStr.Append(comma); >- tmpStr.AppendInt(NS_GET_G(color), 10); >- tmpStr.Append(comma); >- tmpStr.AppendInt(NS_GET_B(color), 10); >+ aResult.AppendInt(NS_GET_R(color), 10); >+ aResult.Append(comma); >+ aResult.AppendInt(NS_GET_G(color), 10); >+ aResult.Append(comma); >+ aResult.AppendInt(NS_GET_B(color), 10); [I wonder why these explicitly state the default radix. This is slightly suboptimal for debug builds but presumably opt builds optimise it away.]
![]() |
Assignee | |
Comment 8•13 years ago
|
||
I have no idea. I was trying for minimal (hence safest) change which would fix the perf issues I was seeing... ;)
![]() |
Assignee | |
Comment 9•13 years ago
|
||
Pushed: http://hg.mozilla.org/mozilla-central/rev/f61c6c4ba5be http://hg.mozilla.org/mozilla-central/rev/51125803eb31
Status: NEW → RESOLVED
Closed: 13 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Whiteboard: [need landing]
Target Milestone: --- → mozilla2.0b8
Comment 10•13 years ago
|
||
Note, Modified_cnvtf allocates a temporary buffer the size of the buffer passed in as argument, which we know is limited to 40 characters (as it is only used with nsTSubstring.cpp itself), so one could use a stack buffer instead. Added this comment to bug 608915 which is about optimizing AppendFloat.
Comment 11•13 years ago
|
||
Backed out the patch for being in the range of bug 615736
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
![]() |
Assignee | |
Updated•13 years ago
|
Whiteboard: [need landing]
![]() |
Assignee | |
Comment 12•13 years ago
|
||
Pushed: http://hg.mozilla.org/mozilla-central/rev/48657c9d5788 http://hg.mozilla.org/mozilla-central/rev/c5136e816bde Tree is green.
Status: REOPENED → RESOLVED
Closed: 13 years ago → 13 years ago
Resolution: --- → FIXED
![]() |
Assignee | |
Updated•13 years ago
|
Whiteboard: [need landing]
Comment 13•12 years ago
|
||
Adding dev-doc-needed, as it looks like MDN documents these on nsString but not nsAString.
Keywords: dev-doc-needed
Updated•3 years ago
|
Component: String → XPCOM
You need to log in
before you can comment on or make changes to this bug.
Description
•