Skip to content

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
@andynu andynu force-pushed the lazy-load-type-mappings-patch branch from 4e15de0 to b614547 Compare July 8, 2022 13:20
@yahonda yahonda self-requested a review July 21, 2022 10:19
@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

@yahonda yahonda merged commit 3ec3919 into rsim:master Sep 15, 2022
@andynu andynu deleted the lazy-load-type-mappings-patch branch March 19, 2024 01:35
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