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 API to support mapping cache capacity configurable #503

Closed
wants to merge 2 commits into from

Conversation

hehechen
Copy link

@hehechen hehechen commented Dec 9, 2022

Signed-off-by: hehechen [email protected]
closes: #499

In some scenarios, users may want to increase MAPPINGS_CACHE_SIZE to trade memory for performance improvement.
This PR add some functions:
resolve_frame_customized_cache
resolve_frame_unsynchronized_customized_cache
resolve_customized_cache
resolve_unsynchronized_customized_cache
So that users can modify cache capacity to improve performance.

Signed-off-by: hehechen <[email protected]>
@hehechen
Copy link
Author

hehechen commented Dec 9, 2022

Same as #500, but change the source branch.

@workingjubilee
Copy link
Member

This complicates things a... lot, in the public API, even, for this performance improvement. Can you elaborate about these "some scenarios", and what is your use case that you want specifically the ability to set a number? In the use-case of std, "backtrace" is usually "one of the last things before the world ends", so yes, we might want to cache more than 4, but I kinda think that we would want to try to lazily cache as many mappings as can fit into memory, because we're going to throw everything away soon anyways? But it sounds a little like you have a different need? Am I mistaken?

@workingjubilee
Copy link
Member

Hmm, judging by this issue, some users will be invoking backtrace... a lot:
#365

Interesting. That helps motivate this a little, but I'm still curious about what your use pattern, and thus what you want us to support, is like.

@workingjubilee
Copy link
Member

Since this seems to have already been a bit stale by the time I got to this crate, I'm going to close this for now. Feel free to reopen when you're ready to discuss it.

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.

Make MAPPINGS_CACHE_SIZE configurable
2 participants