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

Lazy load type mappings #2301

Merged
merged 2 commits into from
Sep 15, 2022
Merged

Conversation

andynu
Copy link
Contributor

@andynu andynu commented Jul 5, 2022

This appears to fix issue #2256. I believe it should have the same memory implications as the intention in #2199. The type maps are loaded once when they are first called. Only one instance of the mapping is ever created.

Fortunately this was enough to solve the problem, but if there were a need, this could easily be worked into the clear_cache! API to reset it at a later point in the application just by setting the @type_map to nil.

(clean patch against the master branch, nothing from the release70 here)

This appears to fix issue rsim#2256. I believe it should have the same memory implications as the intention in rsim#2199. The type maps are loaded once when they are first called. Only one instance of the mapping is ever created.

Fortunately this was enough to solve the problem, but if there were a need, this could easily be worked into the clear_cache! API to reset it at a later point in the application just by setting the @type_map to nil.
@andynu andynu mentioned this pull request Jul 5, 2022
@JRDVN
Copy link

JRDVN commented Sep 15, 2022

@andynu, @yahonda Hey! Any news about this issue? I have the exact same issue on a project and it would be nice to have some fix.

@andynu
Copy link
Contributor Author

andynu commented Sep 15, 2022

I'd be delighted if this PR were merged. If there is anything I can do to help that along I'd be happy to do it.

Meanwhile @JRDVN Here is a monkey patching initializer workaround. https://gist.github.com/andynu/9522d16ab85fd4ec2c2c31903fbe249d

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

Successfully merging this pull request may close these issues.

3 participants