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

cache result? #206

Open
maxnoe opened this issue Nov 29, 2023 · 2 comments
Open

cache result? #206

maxnoe opened this issue Nov 29, 2023 · 2 comments

Comments

@maxnoe
Copy link

maxnoe commented Nov 29, 2023

get_cpu_info takes a relatively long time and seems to do the full work everytime the function is called.

However, there is probably no way this information can change during the lifetime of a running program (maybe I am missing something?).

So the result could be cached and returned immediately on subsequent calls

@anttimc
Copy link

anttimc commented Nov 30, 2023

I found that there is a one-second waiting time when the process just sleeps. See this issue/comment: #205 (comment)

Therefore, I would try to do something else than caching. The one second overhead is there even if the result is cached, and it accumulates per process you run. If you consider a very quick process that calls as a dependency get_cpu_info, and this process is called hundrends or thousands of times per hour, then this overhead becomes unacceptable.

@maxnoe
Copy link
Author

maxnoe commented Nov 30, 2023

oh wow... I didn't realize that this 1 second might not really be needed when patching pytables yesterday to not run this on import but just when needed.

It would really be great to have fine-grained control about what information is gathered, since tables only needs cache sizes I think.

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

No branches or pull requests

2 participants