#6438 closed Bug (fixed)
IE: Performance issue when typing inside an element with many children
Reported by: | Tobiasz Cudnik | Owned by: | Garry Yao |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 3.5.1 |
Component: | General | Version: | 3.0 |
Keywords: | IE | Cc: | zhanyi1022@… |
Description
There is a performance issue when typing inside an element with many children. Reproduced in IE8.
Steps
- Paste content from the attachment into the editor
- Place cursor after last character, but not outside of the paragraph.
- Start typing
Expected: Text is typed as usual.
Actual: There is a serious hangup and CPU consumption.
Attachments (5)
Change History (28)
Changed 14 years ago by
Attachment: | content.txt added |
---|
comment:1 Changed 14 years ago by
Status: | new → confirmed |
---|
comment:2 Changed 14 years ago by
Changed 14 years ago by
Attachment: | 6438.patch added |
---|
comment:3 Changed 14 years ago by
Owner: | set to Garry Yao |
---|---|
Status: | confirmed → review |
Well we also don't want to revert [5452], so the patch doesn't really resolve the issue but at least optimize such case, making the editor usable.
If the proposed approach is rejected, this ticket should be no longer be kept in 3.4.2.
comment:4 Changed 14 years ago by
Status: | review → review_failed |
---|
It's now definitely better, but we should investigate it some more, we may find a way to fix the bug rather than working around it.
comment:5 Changed 14 years ago by
Milestone: | CKEditor 3.4.2 → CKEditor 3.5 |
---|
comment:6 Changed 14 years ago by
Milestone: | CKEditor 3.5 → CKeditor 3.4.3 |
---|
Changed 14 years ago by
Attachment: | 6438_2.patch added |
---|
comment:7 Changed 14 years ago by
Status: | review_failed → review |
---|
Ok, I've managed to simplify things quite a lot, yes, I'm not joking, Fred would be the best reviewer here.
comment:8 Changed 14 years ago by
Well... I'm always strongly afraid when we see part of our code being cut that way. For some good reason it's there.
I'm not reviewing it right now. I'm just leaving a warning notice for now.
comment:9 Changed 14 years ago by
Status: | review → review_failed |
---|
The assumptions from my previous comment unfortunately became true. It was as easy as use SVN blame to check why we have those lines of code there. The patch causes a regression of #5778. Just the reproduction steps need attention:
- Load an editor with enough content to make the scrollbar available in the editor.
- Because of another editor issue, do not use the scrollbar to scroll-down, but do that with the mouse wheel.
- Right-click at the last paragraph.
After patch results: the contents will scroll to the top.
comment:10 Changed 14 years ago by
Status: | review_failed → review |
---|
Changed 14 years ago by
Attachment: | 6438_3.patch added |
---|
comment:11 follow-up: 12 Changed 14 years ago by
Milestone: | CKEditor 3.4.3 → CKEditor 3.5.1 |
---|---|
Status: | review → review_failed |
Version: | 3.4.1 → 3.0 |
In the current code, it's clear that we wanted to disable selection saving while either the mouse button or the keyboard key is down, re-enabling it when they're up. There must surely be a reason for that, but unfortunately I can't recall it (my fault for missing comments).
I think we should not proceed with the patch if we're not able to have the TC that originated that code, otherwise we'll be certainly introducing a regression. I'm removing the review just because of this, so we can give more thinking to this issue.
Couldn't we instead try to have better performance on the selection saving code?
comment:12 follow-up: 13 Changed 14 years ago by
Replying to fredck:
In the current code, it's clear that we wanted to disable selection saving while either the mouse button or the keyboard key is down, re-enabling it when they're up. There must surely be a reason for that, but unfortunately I can't recall it (my fault for missing comments).
With the patch, selection saving happens now on editor blur (and it should), so it makes no sense of keeping the original logic.
Couldn't we instead try to have better performance on the selection saving code?
Haven't find any possibility yet.
comment:13 Changed 14 years ago by
Replying to garry.yao:
With the patch, selection saving happens now on editor blur (and it should), so it makes no sense of keeping the original logic.
That was the original idea when I've implemented the selection saving logic as well, but, if I remember it well, there are some situations where the related blur events are not fired, making the original logic necessary.
As I've said, this is all to be confirmed.
comment:14 follow-up: 15 Changed 14 years ago by
Status: | review_failed → assigned |
---|
comment:15 Changed 14 years ago by
Replying to garry.yao:
Hello,
My company is close to being production ready with our first release built on top of CKEditor. Is this correction still targeted for 3.5.1 or do we need to adjust our timeline?
Thanks, Jay
Changed 14 years ago by
Attachment: | 6438_4.patch added |
---|
comment:16 Changed 14 years ago by
Status: | assigned → review |
---|
Proposing binary search for getBoundaryInformation reduce the complexity to O(logn).
comment:17 Changed 14 years ago by
Note that 6438_4.patch's NOT conflicted with 6438_3.patch, it would be better if both patches could be accepted.
comment:18 Changed 14 years ago by
It's an R+ for me, but I think we need a third reviewer here. Also, it might be for the best to wait with that ticket to the next milestone, to have more time to test it and use the editor with it before releasing to the public.
comment:19 Changed 14 years ago by
Status: | review → review_passed |
---|
There are a few things that could be simplified in the code, but it's generally acceptable. It's a great solution for the problem.
It would be nice to have a few comments to describe what's going on in the code, so it'll be easier to understand the logic. Other than that, there are a few points that need coding style attention.
Better to have a lot of attention on IE during the tests because of this one.
comment:20 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | review_passed → closed |
Thanks for zhanyi for the original idea,fixed with [6337].
comment:21 Changed 14 years ago by
Cc: | zhanyi1022@… added |
---|
comment:22 follow-up: 23 Changed 14 years ago by
Is this patch the same one that was mentioned in #6837 ?
comment:23 Changed 14 years ago by
Replying to alfonsoml:
Is this patch the same one that was mentioned in #6837 ?
Yes, originate from this forum post.
I consider this issue quite important as it's interfered editing experience, it's a regression caused by [5452], the slowness shown in the below stack rooted by 'compareEndPoints' which apparently we cannot avoid.