Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add caching support in multiple levels #20

Open
kb173 opened this issue Apr 1, 2020 · 1 comment
Open

Add caching support in multiple levels #20

kb173 opened this issue Apr 1, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@kb173
Copy link
Member

kb173 commented Apr 1, 2020

There are three places where I think caching could be appropriate:

  • GDALDatasets in the extractors. The overhead of opening a dataset is relatively small and we'd have to check Assess thread safety, make as thread safe as possible #10 first, but with many texture loads per second, there would likely be an improvement.
  • Return values of core Geodot functions like Geodot.get_image. It's plausible that these functions are called with the same arguments multiple times (e.g. to load the same heightmap for the terrain and for the collider in two different places) and this would greatly reduce the cost of consecutive calls.
  • Return values of geodata-class-to-Godot-object functions such as GeoImage.get_image_texture or GeoLine.get_curve3d. These tend to do quite a lot of work for converting the raw C++ data to a Godot class.

In some cases, we'd have to decide whether we want to return exactly the same object or a copy of the previously computed object.

@kb173 kb173 added the enhancement New feature or request label Apr 1, 2020
@kb173 kb173 self-assigned this Apr 1, 2020
@kb173
Copy link
Member Author

kb173 commented Apr 3, 2020

The normal map of the GeoImage, as well as GeoImages themselves (returned from Geodot.get_image) are now cached. The rest can be done similarly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant