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 C functions results (all platforms) #1426

Open
giampaolo opened this issue Feb 24, 2019 · 0 comments
Open

Cache C functions results (all platforms) #1426

giampaolo opened this issue Feb 24, 2019 · 0 comments

Comments

@giampaolo
Copy link
Owner

giampaolo commented Feb 24, 2019

This is similar to PR #1422 but it applies to all platforms which unnecessarily execute the same routine on each call. Instead the routine should be executed on startup and pushed in the global namespace. Possible candidates (I will update this list as I go):

OSX

  • psutil_get_argmax(), used for cmdline() and environ()
  • sysctl.proc_cputype, used by memory USS
  • getpagesize()

BSD

  • getpagesize()

Windows

  • GetSystemInfo used to get the pagesize - affected APIs: cpu_count(), Process.memory_maps(), Process.memory_info_ex() (USS field). [DONE]
  • psutil_get_nic_addresses(), used by net_io_counters(), net_if_addrs(), net_if_stats()
@giampaolo giampaolo reopened this Feb 25, 2019
@giampaolo giampaolo changed the title Load global vars on startup (all platforms) Cache C functions results (all platforms) Feb 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant