Bug 231692 - Poor formatting perfomance on single-line XML files
Summary: Poor formatting perfomance on single-line XML files
Status: VERIFIED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.sse (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 RC1   Edit
Assignee: Nick Sandonato CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard: PMC_approved
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2008-05-12 19:54 EDT by Nick Sandonato CLA
Modified: 2008-06-10 11:34 EDT (History)
2 users (show)

See Also:
david_williams: pmc_approved+
thatnitind: pmc_approved? (raghunathan.srinivasan)
thatnitind: pmc_approved? (naci.dai)
thatnitind: pmc_approved? (deboer)
thatnitind: pmc_approved? (neil.hauge)
thatnitind: pmc_approved? (kaloyan)
thatnitind: review+


Attachments
patch (7.83 KB, patch)
2008-05-12 19:54 EDT, Nick Sandonato CLA
bjorn.freeman-benson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Sandonato CLA 2008-05-12 19:54:41 EDT
Created attachment 99848 [details]
patch

Build ID: I20080429053810

Formatting tends to be impacted severely by many small changes (new lines and tabs). A single-lined, 1MB XML file can take an incredibly long time to format. XML tends to be one of the languages this can be most easily reproduced in, as auto-generated XML documents are common.



I've attached a patch to start moving in the right direction with this. The patch includes creating an unrestricted document rewrite session for the context menu-driven formatting (sequential was creating a deprecated text store that performed slower than the Gap Text Store). Additionally, the presentation reconciler is aware of document rewrite sessions and will not apply style changes until the rewrite session is complete.

Another place to begin looking is at the StructuredDocumentReParser, as some of the files I've formatted have to reparse the document 97k+ times when updating the model.
Comment 1 Nitin Dahyabhai CLA 2008-05-13 00:34:23 EDT
A good start, and a necessary step to avoid performance regressions with the new syntax coloring scheme vs. the old one by shutting off the presentation reconciler during format operations and making sure we use the faster text storage class at all times.  Patch runs well with low risk, invoking the formatting repeatedly.
Comment 2 Nitin Dahyabhai CLA 2008-05-13 02:33:28 EDT
released
Comment 3 Nick Sandonato CLA 2008-06-10 11:34:38 EDT
Verified in S-3.0RC4-20080610084135.