Coder Social home page Coder Social logo

Comments (6)

AlexisDrogoul avatar AlexisDrogoul commented on August 20, 2024

👍

from jts.

dr-jts avatar dr-jts commented on August 20, 2024

Pull Request welcome! Otherwise will have to wait for time to do this.

from jts.

dr-jts avatar dr-jts commented on August 20, 2024

Curious to know more about your use case. Are you seeing this as as hotspot? If you are doing a lot of distance computation, perhaps IndexedFacetDistance might be of use?

from jts.

dr-jts avatar dr-jts commented on August 20, 2024

@cmhodgson Is the issue the ArrayList which is allocated by PolygonExtracter even if there are no polygons?

Perhaps a simple dimension check could be made beforehand, and if dimension < 2 this code can be skpped.

from jts.

cmhodgson avatar cmhodgson commented on August 20, 2024

IndexedFacetDistance is interesting but still uses distanceOp, which then still had the problem that you have now solved.

My use case was finding the closest street segment with a matching name to every address point in the province. There is already an index in place to narrow it down to all the segments with the matching name in the same locality so it isn't really worth the additional memory cost to index those groups spatially. The process only takes 5 mins but minimizing memory use is more important than speeding up the processing as it is a once a month process in production. The overhead of creating and collecting the extra arrays had essentially no effect on the performance time-wise but because of how sensitive Java is to the amount of garbage being collected, having these unused arrays lying around required an extra 1/2 GB of memory to be allocated to keep Java from throwing a "too much garbage collection" exception.

I think I had considered a fix as simple as what you have now done but then got lost in a bunch of other semantic issues that I thought needed "fixing" and forgot about the simple alternative.

from jts.

dr-jts avatar dr-jts commented on August 20, 2024

Good to know this is working for you, Chris.

It seems it's more important to optimize Java memory use than performance (although often the two can be improved together). The recent issue #165 is another example of this.

from jts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.