Modify

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#9024 closed enhancement (fixed)

[patch] bbox/bounds memory optimizations

Reported by: shinigami Owned by: team
Priority: normal Milestone:
Component: Core Version:
Keywords: Cc:

Description

Hi,

bbox/bounds allowed access to coordinates through creation LatLon objects only, which led to creation of looots of useless instances. Example:

return lat() < b.getMin().lat()
lat() > b.getMax().lat() lon() < b.getMin().lon() lon() > b.getMax().lon();

creates 4 objects just to find if point is outside of box.

So I made shortcuts getMinLat() for getMin().lat() etc...
Added few methods consuming (double lat, double lon) instead of (LatLon) to avoid m(new LatLon(lat,lon)) usages.
Changed some implementations. (counting center of rectangle really need not create two objects;)

Attachments (4)

bbox.diff (36.8 KB ) - added by shinigami 11 years ago.
bboxplugins.diff (12.1 KB ) - added by shinigami 11 years ago.
bbox2.diff (39.8 KB ) - added by shinigami 11 years ago.
javadoc added
quads.diff (11.3 KB ) - added by shinigami 11 years ago.

Download all attachments as: .zip

Change History (11)

by shinigami, 11 years ago

Attachment: bbox.diff added

by shinigami, 11 years ago

Attachment: bboxplugins.diff added

comment:1 by Don-vip, 11 years ago

Thanks, there is room for improvements with these classes :)

Can you please first finish javadoc for all new public methods (methods without javadoc + empty javadoc statements such as "@return") ? Thanks.

by shinigami, 11 years ago

Attachment: bbox2.diff added

javadoc added

comment:2 by Don-vip, 11 years ago

Resolution: fixed
Status: newclosed

In 6203/josm:

fix #9024 - bbox/bounds memory optimizations (modified patch by shinigami) + javadoc

comment:3 by Don-vip, 11 years ago

Type: defectenhancement

comment:4 by Don-vip, 11 years ago

Resolution: fixed
Status: closedreopened

comment:5 by Don-vip, 11 years ago

There's something very, very wrong in r6203 that broke rendering of many ways. I set back generated tested release of today to r6201 to fix this (I have no idea right now what happened).

Version 0, edited 11 years ago by Don-vip (next)

comment:6 by Don-vip, 11 years ago

Resolution: fixed
Status: reopenedclosed

In 6204/josm:

fix #9024 - fix problems introduced in r6203

comment:7 by shinigami, 11 years ago

Ee, ugly NaNs, sorry:(

I made few more changes there. First I tried to speed up QuadTiling.tile2LatLon(long quad), but it seems to we do not need it at all.
Look at it, if I understand it well the same can be easily computed from QBLevel parent's bbox and quadrant index.
I removed quad from QBLevel too, it is used nowhere now.

by shinigami, 11 years ago

Attachment: quads.diff added

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.