Open
Bug 1288613
Opened 8 years ago
Updated 2 years ago
Implement Cache for improving performance of ContentEventHandler
Categories
(Core :: DOM: UI Events & Focus Handling, enhancement, P3)
Core
DOM: UI Events & Focus Handling
Tracking
()
NEW
Tracking | Status | |
---|---|---|
firefox50 | --- | affected |
People
(Reporter: masayuki, Unassigned)
Details
(Keywords: inputmethod, perf)
As we know, ContentEventHandler is very slow with big offset in HTML editor.
So, I'm now thinking about how to improve it.
Current my idea is, we should create ContentEventHandler::Cache as a nested class. It has an array whose item is:
class Item final
{
friend class ContentEventHandler;
friend class ContentEventHandler::Cache;
private:
// A node causing text
nsIContent* mContent;
// Generated text
uint32_t mLength;
public:
nsIContent* Content() const { return mContent; }
uint32_t Length() const { return mLength; }
};
And the cache class is like:
class Cache final
{
private:
nsTArray<Item> mItems;
struct HistoryItem final
{
// index of the item
size_t mIndex;
// offset of the item
uint32_t mOffset;
};
// When ContentEventHandler computes a offset, the index and offset are
// stored to mHistory. Then, next query can skip to compute before the
// computed offset.
nsTArray<HistoryItem> mHistory;
};
If it's possible to cache this case in IMEContentObserver, we might be able to improve the performance of multiple query content event handlers, but I'm not sure we can do that with enough simple code.
If you have better idea about cache mechanism, let me know.
# I'm thinking that I could work on this in Q4.
Comment 1•7 years ago
|
||
Masayuki, are you planning to resume this work soon?
Flags: needinfo?(masayuki)
Priority: -- → P2
Reporter | ||
Comment 2•7 years ago
|
||
I'd like to do that as soon as possible, however, the priority isn't so high in my queue.
Flags: needinfo?(masayuki)
Comment 3•6 years ago
|
||
Moving to p3 because no activity for at least 1 year(s).
See https://github.com/mozilla/bug-handling/blob/master/policy/triage-bugzilla.md#how-do-you-triage for more information
Priority: P2 → P3
Assignee | ||
Updated•6 years ago
|
Component: Event Handling → User events and focus handling
Reporter | ||
Updated•5 years ago
|
Type: defect → enhancement
Reporter | ||
Comment 4•4 years ago
|
||
Resetting assignee which I don't work on in this several months.
Assignee: masayuki → nobody
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•