>Thanks go to Jesper Moller for contributing a patch to fix a Major performance bug in the structured text editor. Bug 236883 was causing major delays when typing or invoking content assistance within the XSD, XML, or other SSE based editors that were in the 500K to 1Meg in size. The root cause of the problem as Jesper has outlined is:
…the entire document was being produced as a string thousands of times
with the sole purpose of calling charAt on it.
The code in question was the following:
The issue is that IDocument get() returns a String, and then charAt was being used to get the character. With large documents this is a major performance degradation. Jesper’s solution is subtle but provides a major speed boost.
The change is small, but it accomplishes the same thing with out having to retrieve the entire document into a String. This small change alone is something that improves the useability of the SSE based editors, and helps eliminate one of the complaints on slow performance that the Web Tools Editors can have.
I’ve seen major performance boosts in the XML, XSLT, and XSD editors since this change went into place. This change is available in Web Tools Platform 3.1M6 and will be in the Galileo release in June.