Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#2150 closed Bug (fixed)

Find dialog hangs when searching for word not found in a larger text

Reported by: jonhg Owned by: martinkou
Priority: Normal Milestone: FCKeditor 2.6.1
Component: General Version: SVN (FCKeditor) - Retired
Keywords: Confirmed Review+ Cc:

Description

Scenario:

  1. Paste a larger text into the editor (i.e. the gpl license http://www.gnu.org/licenses/gpl-3.0.txt)
  2. Open the find dialog and search for word not found in the text.
  3. The scripts hangs and after a while the browser ask to stop the script.

Tested in nightly build with firefox on linux and ie7 on windows.

Attachments (7)

2150_pre.patch (20.7 KB) - added by martinkou 9 years ago.
2150.patch (22.4 KB) - added by martinkou 9 years ago.
2150_2.patch (22.3 KB) - added by martinkou 9 years ago.
2150_3.patch (22.3 KB) - added by martinkou 9 years ago.
2150_4.patch (22.5 KB) - added by martinkou 9 years ago.
2150_5.patch (22.6 KB) - added by martinkou 9 years ago.
2150_6.patch (22.6 KB) - added by martinkou 9 years ago.

Download all attachments as: .zip

Change History (23)

comment:1 Changed 9 years ago by martinkou

  • Keywords Confirmed added
  • Milestone set to FCKeditor 2.6.1
  • Version set to SVN

Confirmed. It's a pretty major bug so I'm targeting it to 2.6.1.

comment:2 Changed 9 years ago by martinkou

btw the search seems to have gotten stuck somewhere in the middle of the GNU license so I'm quite sure this is a bug rather than a speed issue.

comment:3 Changed 9 years ago by w.olchawa

Tested on IE6, IE7 and FF2 - in all of my tests the browsers collapsed.

comment:4 Changed 9 years ago by martinkou

  • Owner set to martinkou
  • Status changed from new to assigned

comment:5 Changed 9 years ago by martinkou

I was wrong yesterday. Further tests indicated that the search logic didn't actually got stuck, but the GetData() function took longer and longer to execute per call as the search proceeds down the document.

Changed 9 years ago by martinkou

comment:6 Changed 9 years ago by martinkou

I've written a preliminary patch which re-implements the finding logic of the Find/Replace dialog. Improvements include:

  1. A factor-of-ten or greater improvement in searching performance, which eliminates the freeze up in searching long documents like the GPL 3.0. Note that while the new implementation would no longer hang scanning the GPL 3.0, it would still hang if given a much larger document - any classical search function still has to scan every DOM node and every character of the document no matter how fast it is, we aren't using quantum computers/quantum algorithms yet ;).
  2. Reduced code size of fck_replace.html, because the new algorithm is simpler.

comment:7 Changed 9 years ago by martinkou

The preliminary patch should be nearly completely functional, the only thing that doesn't work yet is the "Match whole word" option.

comment:8 Changed 9 years ago by martinkou

#2159 and #2160 are related to this ticket.

Changed 9 years ago by martinkou

comment:9 Changed 9 years ago by martinkou

  • Keywords Review? added

Changed 9 years ago by martinkou

comment:10 Changed 9 years ago by martinkou

Updated patch which removes the FCKDomTools.ScrollIntoView() hack for Safari in the Find/Replace dialog, because the hack was found to not work.

Changed 9 years ago by martinkou

comment:11 Changed 9 years ago by martinkou

Updated the patch again because the match whole word option was found to not work after the search has scanned through the document the first time.

comment:12 Changed 9 years ago by fredck

  • Keywords Review- added; Review? removed

The patch is breaking simple searchs. Just try to search for "a", hitting the search button several times. It will throw a js error.

Changed 9 years ago by martinkou

comment:13 Changed 9 years ago by martinkou

  • Keywords Review? added; Review- removed

Changed 9 years ago by martinkou

Changed 9 years ago by martinkou

comment:14 Changed 9 years ago by fredck

  • Keywords Review+ added; Review? removed

comment:15 Changed 9 years ago by martinkou

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed with [1973].

Click here for more info about our SVN system.

comment:16 Changed 9 years ago by w.olchawa

#2216 has been marked as DUP

Note: See TracTickets for help on using tickets.
© 2003 – 2016 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy