![]() |
|
|||||||
| Development Help Help for building applications or diagnosing problems with WWJ |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: May 2007
Location: Toulouse
Posts: 120
![]() |
I've noticed a sensible lack of performance on the WMS capabilities parser, it takes 5 mn to parse my local server capabilities. I've read the code and i think it could be optimized, it do around 1000 xpath request on the document to parse. The biggest problem is that each getter on a field of the document do a xpath.
example : Code:
public String getVersion()
{
return this.getText("*/@wms:version");
}
Code:
private String version= null;
public String getVersion()
{
if (version== null) {
version= this.getText("*/@wms:version");
}
return version;
}
What do you think about this, Tag?
__________________
-Nicolas CASTEL- Thales Alenia Space, Toulouse, France- Last edited by vash; 07-25-2007 at 03:16 PM. |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: May 2007
Location: Toulouse
Posts: 120
![]() |
I've finished the redesign. The redesigned parser spent 10s to parse the same file vs 5 mn for the original parser.
http://nicastel.free.fr/worldwind/wms_cap_parser.zip
__________________
-Nicolas CASTEL- Thales Alenia Space, Toulouse, France- Last edited by vash; 07-26-2007 at 12:48 PM. |
|
|
|
|
|
#3 |
|
WWJ Technical Manager
Join Date: May 2007
Location: Seattle
Posts: 1,031
![]() |
Thanks! What'd you do?
|
|
|
|
|
|
#4 |
|
Senior Member
Join Date: May 2007
Location: Toulouse
Posts: 120
![]() |
I've applied the pattern explained in my first post on all the methods of Capabalities and derived classes.
For the method which takes an element in parameter such as the Layer Items methods, i've created a inner class which contains all the fields necessary and wrap an element, and i've redesigned the methods associed. example : Code:
public String getLayerAbstract(Element layer)
{
return this.getText(element, "wms:Abstract");
}
Code:
public class LayerElement {
public Element element;
public String layerAbstract = null;
public String layerAttributionTitle = null;
public String layerAttributionURL = null;
public String layerAttributionLogoFormat = null;
public String layerAttributionLogoHeight = null;
public String layerAttributionLogoURL = null;
public String layerAttributionLogoWidth = null;
public MetadataElement[] layerAuthorityURLs = null;
public BoundingBox[] layerBoundingBoxes = null;
public String layerCascaded = null;
public String[] layerCRS = null;
public String layerDataURLFormat = null;
public String layerDataURL = null;
public DimensionElement[] layerDimensions = null;
public DimensionElement[] layerExtents = null;
public BoundingBox layerGeographicBoundingBox = null;
public String layerFeatureListFormat = null;
public String layerFeatureListURL = null;
public String layerFixedHeight = null;
public String layerFixedWidth = null;
public IdentifierElement[] layerIdentifiers = null;
public String[] layerKeywordList = null;
public String layerMaxScaleDenominator = null;
public MetadataElement[] layerMetadataURLs = null;
public String layerMinScaleDenominator = null;
public String layerName = null;
public String layerNoSubsets = null;
public String layerOpaque = null;
public String layerQueryable = null;
public String[] layerSRS = null;
public StyleElement[] layerStyles = null;
public LayerElement[] layerSubLayers = null;
public String layerTitle = null;
public LayerElement(Element element) {
this.element = element;
}
}
public String getLayerAbstract(LayerElement layer)
{
if (layer.layerAbstract == null) {
layer.layerAbstract = this.getText(layer.element, "wms:Abstract");
}
return layer.layerAbstract;
}
__________________
-Nicolas CASTEL- Thales Alenia Space, Toulouse, France- |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| WMS Browser Problem | armin | Technical Support | 1 | 03-20-2007 04:41 PM |
| WMS Server Conncection Problem | mjd | Technical Support | 3 | 01-24-2007 12:28 AM |
| slight performance problem after patching to 1.31 | Guest_max_* | Technical Support | 2 | 04-03-2005 02:45 PM |