Forum closed. New forum available at http://community.wymeditor.org/

Speeding up container() method

Discuss features, code, contributions, ideas, suggestions, ...
For bugs, patches and feature requests, please post on the Trac:
http://trac.wymeditor.org/

Speeding up container() method

Postby strykker on Wed Jan 21, 2009 7:07 am

While working on some custom containers, I noticed that the container method can be rather slow. I profiled this and found that the update() method called at the end which calls the xhtml parser was taking up to 3 seconds in some cases, making the use of containers un-bearable.
When adding containers, we are in full control of the (x)html we insert , so is it really necessary to re-parse the html every time we add a container element. For my app, I have removed the call to the xhtml parser in the container method (ie.e. don;t simply call update() , but simply call
Code: Select all
jQuery(this._element).val(html);
jQuery(this._box).find(this._options.htmlValSelector).val(html);

instead of update(). And this has improved the performance of my app significantly.

- Eric
strykker
 
Posts: 6
Joined: Wed Jan 21, 2009 6:49 am

Return to Developers

Who is online

Users browsing this forum: No registered users and 1 guest

cron