Opened 12 years ago

Closed 11 years ago

#382 closed defect (fixed)

GriddedGeoDataSet performance

Reported by: Ned Field Owned by: Kevin Milner
Priority: major Milestone: OpenSHA 1.3
Component: commons Version:
Keywords: Cc:


The following methods of GriddedGeoDataSet? are really slow:

contains(Location loc)
get(Location loc)
getLocation(int index)

due to the use of nodeList (a LocationList? that comes from nodeList = region.getNodeList(), where region is the GriddedRegion? passed in the constructor).

The reason is nodeList.indexOf(loc) is much slower than region.indexForLocation(loc).

For my problem (ERF_Calculator.getNucleationRatesInRegion((*)) it was at least two orders of magnitude, maybe more.

I don't think nodeList is even needed in this class, as methods from the region object can provide the info in the above methods, and getLocationLIst() can just return region.getNodeList().

I also don't think the HashMap? is needed (a double[] array for z-axis values should do), although I haven't thought through the use of the latitudeX boolean in this context.

I haven't made any changes in case revision to junit tests also need to be made.

Change History (1)

comment:1 Changed 11 years ago by Kevin Milner

Resolution: fixed
Status: newclosed

This was done long ago, now uses fast methods from the GriddedRegion? object

Note: See TracTickets for help on using tickets.