Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#1030 closed defect (fixed)

InternetExplorer.prototype.inwardHtml

Reported by: guest Owned by: gogo
Priority: normal Milestone:
Component: Xinha Core Version:
Severity: normal Keywords: Internet Explorer script
Cc:

Description

The method InternetExplorer?.prototype.inwardHtml of the file 'modules/InternetExplorer/InternetExplorer.js'
under IE is very very slow (since ticket 735).

Extract :

Both IE and Gecko use strike internally instead of del (#523)

Xinha will present del externally (see Xinha.prototype.outwardHtml
html = html.replace(/<(\/?)del(\s|>|\/)/ig, "<$1strike$2");
ie eats scripts and comments at beginning of page, so
make sure there is something before the first script on the page
html = html.replace(/(&nbsp;)?([\s\S]*?)(<script|<!--)/i,"$2&nbsp;$3");

It's totally unsuable under my Pentium IV 2.8 Ghz with an edited page of 23000 chars of html code. If I comment the second line, it's very fast.

Is there a way to speed the second regular expression? Like applying it only to a subset of the html (a substr from the first <script position for example).

My solution is to disable it enterely at our site because we don't need to support that use case but I had to search for a while before finding the bottleneck. It might help others ...

Thanks

Frederick

Change History (3)

comment:1 Changed 10 years ago by wymsy

changeset:839 changes the re to one that should be fast. Please try it and report back if it fixes the problem or not. thx

comment:2 Changed 10 years ago by wymsy

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

Well, it works well in my tests, so I'm closing this. If anyone still has problems, feel free to reopen.

comment:3 Changed 10 years ago by guest

I do confirm that your fix is way faster and still works.

Thanks and sorry for the delay.

Frederick

Note: See TracTickets for help on using tickets.