Speed up frequently called GetLength() on SourceBufferResource

RESOLVED FIXED in mozilla34

Status

()

RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: kinetik, Assigned: kinetik)

Tracking

unspecified
mozilla34
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

4 years ago
GetLength() is called fairly frequently and the existing implementation is O(n).  It's simple to cache a logical length that's updated as new data is appended and return that.
(Assignee)

Comment 1

4 years ago
Created attachment 8474960 [details] [diff] [review]
Accumulate SBR length rather than recomputing on each call.
Attachment #8474960 - Flags: review?(cajbir.bugzilla)
(Assignee)

Updated

4 years ago
Attachment #8474960 - Attachment description: Accumlate SBR length rather than recomputing on each call. → Accumulate SBR length rather than recomputing on each call.

Updated

4 years ago
Attachment #8474960 - Flags: review?(cajbir.bugzilla) → review+

Comment 3

4 years ago
https://hg.mozilla.org/mozilla-central/rev/1cebb180893a
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in before you can comment on or make changes to this bug.