Modify

Opened 6 years ago

Closed 6 years ago

Last modified 6 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 6 years ago.
bboxplugins.diff (12.1 KB) - added by shinigami 6 years ago.
bbox2.diff (39.8 KB) - added by shinigami 6 years ago.
javadoc added
quads.diff (11.3 KB) - added by shinigami 6 years ago.

Download all attachments as: .zip

Change History (11)

Changed 6 years ago by shinigami

Attachment: bbox.diff added

Changed 6 years ago by shinigami

Attachment: bboxplugins.diff added

comment:1 Changed 6 years ago by Don-vip

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.

Changed 6 years ago by shinigami

Attachment: bbox2.diff added

javadoc added

comment:2 Changed 6 years ago by Don-vip

Resolution: fixed
Status: newclosed

In 6203/josm:

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

comment:3 Changed 6 years ago by Don-vip

Type: defectenhancement

comment:4 Changed 6 years ago by Don-vip

Resolution: fixed
Status: closedreopened

comment:5 Changed 6 years ago by Don-vip

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

Last edited 6 years ago by Don-vip (previous) (diff)

comment:6 Changed 6 years ago by Don-vip

Resolution: fixed
Status: reopenedclosed

In 6204/josm:

fix #9024 - fix problems introduced in r6203

comment:7 Changed 6 years ago by shinigami

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.

Changed 6 years ago by shinigami

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.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.