"gyles19@visi.com via RT" <bug-Tk-XMLViewer@rt.cpan.org> writes:
Show quoted text> Thu Oct 11 10:19:50 2007: Request 29922 was acted upon.
> Transaction: Ticket created by gyles19@visi.com
> Queue: Tk-XMLViewer
> Subject: Widget is unresponsive while parsing large files
> Broken in: (no value)
> Severity: Normal
> Owner: Nobody
> Requestors: gyles19@visi.com
> Status: new
> Ticket <URL:
http://rt.cpan.org/Ticket/Display.html?id=29922 >
>
>
> I have large xml files (100k or better) containing GPS POI information.
> When I ask XMLViewer to display one, the app hangs for 10+ minutes while the
> parser handlers fill the viewer widget.
>
> I added a call to $w->update inside _flush. The app now responds during
> the parsing process, but it's still taking a very long time to build the
> viewer. This may not be the best place to put the update call, but it
> served to illustrate the issue.
>
> I've attached a zipped xml file for demonstration purposes. (I captured the
> data myself so there are no entanglements on it should you wish to use it as
> test data.)
>
> I'm using Perl 5.8.8, Tk 804.027, Red Hat Linux 7.3 running on a Thinkpad
> with 1gig of ram and a 1Ghz cpu.
>
Well, your XML is not really that large. 120kB should be handled
gracefully by today's computers. There seems to be some kind of
exponential growth. If I create smaller files from your sample file
and try to load them into XMLViewer, then I get the following results:
$ for i in truckstops-*; do echo $i; time perl -MTk::XMLViewer -MTk -e '$v=tkinit->XMLViewer->pack;$v->insertXML(-file => shift);' $i; done
truckstops-1000.gpx
perl -MTk::XMLViewer -MTk -e $i 0,18s user 0,05s system 41% cpu 0,562 total
truckstops-10000.gpx
perl -MTk::XMLViewer -MTk -e $i 0,50s user 0,01s system 91% cpu 0,559 total
truckstops-30000.gpx
perl -MTk::XMLViewer -MTk -e $i 5,26s user 0,04s system 42% cpu 12,431 total
truckstops-60000.gpx
perl -MTk::XMLViewer -MTk -e $i 52,28s user 0,10s system 35% cpu 2:26,89 total
truckstops-90000.gpx
(still running)
I suspect it's some Tk::Text slowness. Time for some profiling and
optimization!
Regards,
Slaven
--
Slaven Rezic - slaven <at> rezic <dot> de
tktimex - time recording tool
http://sourceforge.net/projects/ptktools/