This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 116806 - opening schema takes too long time
Summary: opening schema takes too long time
Status: VERIFIED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Schema (show other bugs)
Version: 6.x
Hardware: PC All
: P3 blocker (vote)
Assignee: Samaresh Panda
URL:
Keywords: PERFORMANCE, TEST
: 117672 (view as bug list)
Depends on: 125055
Blocks:
  Show dependency tree
 
Reported: 2007-09-26 11:34 UTC by Rashid Urusov
Modified: 2008-03-11 16:45 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
text-edit patch (1.98 KB, patch)
2007-09-26 18:45 UTC, Samaresh Panda
Details | Diff
The DocumentModel and XMLFoldManager patch (4.33 KB, patch)
2007-09-27 11:03 UTC, Marek Fukala
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rashid Urusov 2007-09-26 11:34:45 UTC
Automated performance tests shows increase of time for Open schema view  and Open complex schema view testcases.
For first one we use project "TravelReservationService" and schema "OTA_TravelItinerary" for second project HL7 and
schema "fields". In comparision with previous build there is sufficient regression : from 5 up to 15 sec  and from 15
up to 62 sec respectively for these cases.
Comment 1 Rashid Urusov 2007-09-26 11:38:16 UTC
P.S. threshold for thess actions is 1000 ms.
Comment 2 Samaresh Panda 2007-09-26 16:54:31 UTC
Indeed, I do see a big overhead.
Comment 3 Samaresh Panda 2007-09-26 18:41:28 UTC
Marek, the getDocumentModel() inside initFolds() seems to be very expensive while opening of the file. I have a patch
that will fix the problem, however it has a side effect as well. When file is big, the folds may not be seen first time.
So I was wondering if there is a way to refresh the folds when the ReqProcessor finishes.

If SwingUtilities.invokeLater is used instead of RequestProvessor, switching to source view holds the UI for a while for
obvious reason. So I prefer RequestProvessor.
Comment 4 Samaresh Panda 2007-09-26 18:45:38 UTC
Created attachment 49598 [details]
text-edit patch
Comment 5 Marek Fukala 2007-09-27 11:02:45 UTC
Please better use the attached patch. It is a kind of hack though the main idea is correct. I hope it is self explanatory.

I am sorry for doing the performance regression. I was aware of this, I didn't have much time to tune the last change,
it was just a prototype showing how it can work.

Regards,
Marek
Comment 6 Marek Fukala 2007-09-27 11:03:43 UTC
Created attachment 49661 [details]
The DocumentModel and XMLFoldManager patch
Comment 7 Samaresh Panda 2007-09-27 18:14:08 UTC
I'm sorry, there is no folds whatsoever with this patch. Once you have a fix, can you please open fields.xsd file (under
hl7 unit test package in xml/axi module). It shouldn't take more than 3sec to open and of course, folds should be there :).

Please take a look (if you didn't) at the patch I suggested and see if that can be improved to refresh the folds.
Comment 8 Samaresh Panda 2007-10-04 23:05:57 UTC
*** Issue 117672 has been marked as a duplicate of this issue. ***
Comment 9 Marek Fukala 2007-10-05 12:51:31 UTC
I tried to fix the patch but found some other problems. Fixing of them requires some time which I do not have
unfortunatelly. Mayby you can use your own patch.
Comment 10 tonybeckham 2007-10-26 20:31:45 UTC
On linux, I do see a downgrade in performance, but not as drastic as Desc1 states.  With the following system:
Product Version: NetBeans IDE 6.0 Beta 2 (Build 200710212201)
Java: 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b05
System: Linux version 2.6.22-14-generic running on i386; UTF-8; en_US (nb) 
To open OTA is about 8 sec. and to open Fields is about 11 sec.  I don't think it is that bad.

Using an older build on the same system:
Product Version: NetBeans IDE 6.0 Beta 2 (Build 200709201200)
Java: 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b05
System: Linux version 2.6.22-14-generic running on i386; UTF-8; en_US (nb)  
I get times of about 4 sec to open OTA and about 2 sec to open Fields.

I suggest downgrading to a P3.  Any objections?


Comment 11 Sonali Kochar 2007-10-26 22:13:54 UTC
Sounds reasonable to me...
Comment 12 tonybeckham 2007-10-29 17:43:47 UTC
There were no objections.  Downgrading to P3.
Comment 13 Samaresh Panda 2008-02-08 04:30:08 UTC
Fix integrated: http://hg.netbeans.org/main/rev/26fbf1aa6d3a
The fold manager is completely re-written using lexer. It doesn't use the document model anymore.

fields.xsd takes about 3-4 sec and OTA schema takes about 2sec.
Comment 14 Marek Fukala 2008-02-10 12:17:34 UTC
>fields.xsd takes about 3-4 sec and OTA schema takes about 2sec.
On each document change? I cannot imaging the way how you optimize the folds update without rescanning the whole document. 
Comment 15 tonybeckham 2008-02-13 18:49:17 UTC
Wow, opening is soooo much faster now even for huge schema like HL7 fields.xsd and reopenings!
Fix Verified.

Product Version: NetBeans IDE Dev (Build 200802120006)
Java: 1.5.0_13; Java HotSpot(TM) Client VM 1.5.0_13-119
System: Mac OS X version 10.5.2 running on i386; MacRoman; en_US (nb)