Hi Bart,
Thanks for the additional information, I didn't realize that setFrom
was being called in a situation where a GUI was not being prepared. I
had forgotten about the EsriGraphic convert functions, though. I think
you're right, removing resetGUI from the setFrom method is nothing but
good. I've checked in that change.
- Don
On Thursday, October 16, 2003, at 03:53 AM, Bart Jourquin wrote:
>>> My app has to load large shape files (EsriPlugin) and, doing so, it
>>> has its performances dramatically decreased.
>>>
>>> I tried to profile it and the result if this tracing shows that more
>>> than 96% the CPU time is spent in the following sequence:
>>>
>>> getEsrilGraphicList() -> getGeometry() -> <CUT> ->
>>> DrawingAttributes.setFrom().
>>
>>
>> I can't follow this path to DrawingAttributes.setFrom(). I just get
>> to setTo(). Can you give me more info on how you are getting to the
>> setFrom() method?
>
>
> Sure Don, see the 'data.html' attachment: it is a snaphot generated by
> OptimizeIt CPU profiler.
>
> (I think you can download a trial version of OptimizeIt on
> borland.com. That's why I have also attached a complete profiler
> session info snapshot)
>
>
> <CUT>
>
>>>
>>> My question is thus simple: is the call to resetGUI() needed there?
>>> I have the impression that it is only needed by getColorAndLineGUI()
>>> which also calls resetGUI()...
>>
>>
>> It's really there for the drawing tool or for a layer that has a
>> DrawingAttributes GUI displayed, and an OMGraphic is selected. By
>> calling resetGUI in setFrom, the GUI updates to show what the
>> settings are in the OMGraphic.
>
>
> Yes, I can understand that you need this when you will show the
> settings, but do you need to build the GUI for each graphic at load
> time? I have several thousands shapes on my map, so that several
> thousand jbuttons and other GUI components are created... This isn't
> only a very important CPU charge, but it has only a big impact on the
> heap...
>
> When I look the the code, I think (but I may be wrong) that the GUI
> components for a given graphic only must be created when the GUI is
> displayed. getColorAndLineGUI() already does this job by calling
> resetGUI() but no buttons are created at that time because they
> already have a non null value. I guess that if you remove the call to
> resetGUI in setFrom(), it doesn't harm anything, because the call to
> resetGUI in getColorAndLineGUI() will then create the GUI components.
>
> As I told in my previous message, my layers are now loaded in a few
> seconds (less that 10) while, with the original code, these same big
> layers needed between 4 and 5 minutes to load....
>
> What do you think?
>
> Bart
>
>
>>
>> - Don
>>
>> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>> Don Dietrick, BBN Technologies, dietrick@bbn.com
>> 10 Moulton Street, Cambridge, MA 02138
>> 617-873-3031 [fax]-2794
>> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>>
>
> --
> Prof Dr Bart Jourquin
> F.U.Ca.M. - G.T.M.
> Chaussee de Binche, 151a
> B7000 Mons
> Belgium
> Tel. : +32 65 323293
> Fax. : +32 65 315691
> http://message.fucam.ac.be/~jourquin
>
> Profiler output for thread Thread-10 . attached application (CPU
> profiler output - Sampler / Lines)
>
<image.tiff> Description of CPU usage for thread Thread-10
> <image.tiff> 100.0% - 136461 ms -
> com.bbn.openmap.util.SwingWorker$2.run() (SwingWorker.java:107)
> <image.tiff> 100.0% - 136461 ms -
> com.bbn.openmap.layer.OMGraphicHandlerLayer$LayerWorker.construct()
> (OMGraphicHandlerLayer.java:548)
> <image.tiff> 100.0% - 136461 ms -
> com.bbn.openmap.layer.policy.StandardRenderPolicy.prepare()
> (StandardRenderPolicy.java:67)
> <image.tiff> 100.0% - 136461 ms -
> com.bbn.openmap.plugin.PlugInLayer.prepare() (PlugInLayer.java:311)
> <image.tiff> 99.27% - 135471 ms -
> com.bbn.openmap.plugin.esri.EsriPlugIn.getRectangle()
> (EsriPlugIn.java:378)
> <image.tiff> 99.27% - 135471 ms -
> com.bbn.openmap.plugin.esri.EsriPlugIn.getEsriGraphicList()
> (EsriPlugIn.java:315)
> <image.tiff> 99.27% - 135471 ms -
> com.bbn.openmap.plugin.esri.EsriPlugIn.getGeometry()
> (EsriPlugIn.java:397)
> <image.tiff> 99.27% - 135471 ms -
> com.bbn.openmap.dataAccess.shape.EsriGraphicList.getEsriGraphicList()
> (EsriGraphicList.java:226)
> <image.tiff> 99.27% - 135471 ms -
> com.bbn.openmap.dataAccess.shape.input.ShpInputStream.getGeometry()
> (ShpInputStream.java:81)
> <image.tiff> 98.69% - 134679
> ms -
> com.bbn.openmap.dataAccess.shape.input.ShpInputStream.getPolyGeometry()
> (ShpInputStream.java:282)
> <image.tiff> 98.69% -
> 134679 ms - com.bbn.openmap.dataAccess.shape.EsriPolylineList.add()
> (EsriPolylineList.java:48)
> <image.tiff> 98.03% -
> 133786 ms - com.bbn.openmap.dataAccess.shape.EsriPolyline.convert()
> (EsriPolyline.java:97)
> <image.tiff> 98.03%
> - 133786 ms - com.bbn.openmap.omGraphics.DrawingAttributes.setFrom()
> (DrawingAttributes.java:665)
> <image.tiff> 21
> .15% - 28862 ms -
> com.bbn.openmap.omGraphics.DrawingAttributes.resetGUI()
> (DrawingAttributes.java:1032)
> <image.tiff> 19
> .92% - 27192 ms -
> com.bbn.openmap.omGraphics.DrawingAttributes.resetGUI()
> (DrawingAttributes.java:1022)
> <image.tiff> 17
> .85% - 24364 ms -
> com.bbn.openmap.omGraphics.DrawingAttributes.resetGUI()
> (DrawingAttributes.java:995)
> <image.tiff> 17
> .68% - 24138 ms -
> com.bbn.openmap.omGraphics.DrawingAttributes.resetGUI()
> (DrawingAttributes.java:1004)
> <image.tiff> 16
> .92% - 23099 ms -
> com.bbn.openmap.omGraphics.DrawingAttributes.resetGUI()
> (DrawingAttributes.java:1013)
> <image.tiff> 1.
> 77% - 2422 ms -
> com.bbn.openmap.omGraphics.DrawingAttributes.resetGUI()
> (DrawingAttributes.java:1039)
> <image.tiff> 0.
> 78% - 1071 ms -
> com.bbn.openmap.omGraphics.DrawingAttributes.resetGUI()
> (DrawingAttributes.java:1016)
> <image.tiff> 0.
> 51% - 698 ms - com.bbn.openmap.omGraphics.DrawingAttributes.resetGUI()
> (DrawingAttributes.java:1035)
> <image.tiff> 0.
> 49% - 673 ms - com.bbn.openmap.omGraphics.DrawingAttributes.resetGUI()
> (DrawingAttributes.java:1007)
> <image.tiff> 0.
> 33% - 460 ms - com.bbn.openmap.omGraphics.DrawingAttributes.resetGUI()
> (DrawingAttributes.java:998)
> <image.tiff> 0.
> 2% - 280 ms - com.bbn.openmap.omGraphics.DrawingAttributes.resetGUI()
> (DrawingAttributes.java:996)
> <image.tiff> 0.
> 13% - 180 ms - com.bbn.openmap.omGraphics.DrawingAttributes.resetGUI()
> (DrawingAttributes.java:992)
> <image.tiff> 0.
> 11% - 160 ms - com.bbn.openmap.omGraphics.DrawingAttributes.resetGUI()
> (DrawingAttributes.java:1024)
> <image.tiff> 0.
> 1% - 147 ms - com.bbn.openmap.omGraphics.DrawingAttributes.resetGUI()
> (DrawingAttributes.java:1025)
> <image.tiff> 0.
> 01% - 20 ms - com.bbn.openmap.omGraphics.DrawingAttributes.resetGUI()
> (DrawingAttributes.java:1034)
> <image.tiff> 0.
> 01% - 20 ms - com.bbn.openmap.omGraphics.DrawingAttributes.resetGUI()
> (DrawingAttributes.java:1005)
> <image.tiff> 0.46% -
> 640 ms - com.bbn.openmap.dataAccess.shape.EsriPolyline.convert()
> (EsriPolyline.java:98)
> <image.tiff> 0.17% -
> 233 ms - com.bbn.openmap.dataAccess.shape.EsriPolyline.convert()
> (EsriPolyline.java:96)
> <image.tiff> 0.01% -
> 20 ms - com.bbn.openmap.dataAccess.shape.EsriPolyline.convert()
> (EsriPolyline.java:94)
> <image.tiff> 0.14% - 200 ms -
> com.bbn.openmap.dataAccess.shape.input.ShpInputStream.getPolyGeometry()
> (ShpInputStream.java:198)
> <image.tiff> 0.12% - 170 ms -
> com.bbn.openmap.dataAccess.shape.input.ShpInputStream.getPolyGeometry()
> (ShpInputStream.java:199)
> <image.tiff> 0.08% - 120 ms -
> com.bbn.openmap.dataAccess.shape.input.ShpInputStream.getPolyGeometry()
> (ShpInputStream.java:260)
> <image.tiff> 0.08% - 120 ms -
> com.bbn.openmap.dataAccess.shape.input.ShpInputStream.getPolyGeometry()
> (ShpInputStream.java:242)
> <image.tiff> 0.04% - 63 ms -
> com.bbn.openmap.dataAccess.shape.input.ShpInputStream.getPolyGeometry()
> (ShpInputStream.java:252)
> <image.tiff> 0.04% - 59 ms -
> com.bbn.openmap.dataAccess.shape.input.ShpInputStream.getPolyGeometry()
> (ShpInputStream.java:194)
> <image.tiff> 0.01% - 20 ms -
> com.bbn.openmap.dataAccess.shape.input.ShpInputStream.getPolyGeometry()
> (ShpInputStream.java:269)
> <image.tiff> 0.01% - 20 ms -
> com.bbn.openmap.dataAccess.shape.input.ShpInputStream.getPolyGeometry()
> (ShpInputStream.java:285)
> <image.tiff> 0.01% - 20 ms -
> com.bbn.openmap.dataAccess.shape.input.ShpInputStream.getPolyGeometry()
> (ShpInputStream.java:200)
> <image.tiff> 0.72% - 990 ms -
> com.bbn.openmap.plugin.esri.EsriPlugIn.getRectangle()
> (EsriPlugIn.java:381)
>
>
>
> <snapshot_14-oct.-2003_18-01-29.snp>
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Don Dietrick, BBN Technologies, dietrick@bbn.com
10 Moulton Street, Cambridge, MA 02138
617-873-3031 [fax]-2794
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-- [To unsubscribe to this list send an email to "majdart@bbn.com" with the following text in the BODY of the message "unsubscribe openmap-users"]Received on Thu Oct 16 10:16:43 2003
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:36 EDT