Code Monkey home page Code Monkey logo

Comments (6)

leogama avatar leogama commented on July 24, 2024

My suggestion to optimize this is to have an internal environment where the parseGPL (or maybe the .parseGPLWithLimits) function could check for a cached version of the GPL object read from the file path passed as argument.

Some possible details necessary for this feature to work are:

  • distinguish between objects that were parsed with different number of rows limits
  • give the user an option to not use the cached version
  • even if not explicitly specified, ignore the cached version if the original file was modified

Do you think this is reliable? It's just an initial idea...

from geoquery.

seandavi avatar seandavi commented on July 24, 2024

There are really two issues you have touched on:

  1. Avoiding parsing the same GPL multiple times
  2. A caching mechanism that is smart enough to keep GPLs around throughout a session.

I like the idea of number 1, but I would be concerned that keeping GPLs around in memory (number 2) might end up biting some users who don't realize this in-memory caching is going on. I think what might make sense is the ability to pass in a list of GPL objects to getGEO() and getGEO would then check if a required GPL is already in the list. If so, getGEO would use it and not download and reparse. If not, the GPL would be fetched. In a sense, we would leave caching to the user, making it less magical and less likely to catch new and "casual" users off-guard.

So, I would propose adding another argument to getGEO:

getGEO(..., GPLlist = list(GPL, GPL, GPL, ...))

What do you think, @leogama?

from geoquery.

leogama avatar leogama commented on July 24, 2024

from geoquery.

leogama avatar leogama commented on July 24, 2024

from geoquery.

seandavi avatar seandavi commented on July 24, 2024

Sorry to take so long to get back to you. How would you want to do the caching? In memory? On disk? If on disk, in what format?

from geoquery.

leogama avatar leogama commented on July 24, 2024

I think @seandavi and me forgot to close this issue after merging #24. Mr. @assaron even developed his own file cache solution.

At the time, I thought the message displayed at the package loading was enough to give users a clue about this functionality. Should it be explicitly documented somewhere? Or maybe just add the word cache to the option's name...

from geoquery.

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.