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

Lazily initialize Profile buffer #46239

Merged

Conversation

IanButterworth
Copy link
Member

@IanButterworth IanButterworth commented Aug 2, 2022

Because Profile is in the sysimage, its __init__() that currently sets the buffer up is called during julia startup, meaning that the profile buffer is allocated during julia startup whether or not you're using Profile.

This changes the default init to be lazy, at the time of the first @profile call.

Hoping to alleviate issues like #45434

Todo:

  • Figure out what to do if the first profile call this session is a SIGINFO/SIGUSR1 request. We can't call the julia default_init() code there.. Update: Now initialized with default values if needed directly by trigger_profile_peek

@IanButterworth IanButterworth added the backport 1.8 Change should be backported to release-1.8 label Aug 2, 2022
@IanButterworth IanButterworth requested a review from vtjnash August 2, 2022 15:42
@IanButterworth IanButterworth force-pushed the ib/profile_lazy_buffer branch from 4c75b0a to 79ad2c7 Compare August 2, 2022 19:42
@IanButterworth IanButterworth force-pushed the ib/profile_lazy_buffer branch from 17e211e to f6241a5 Compare August 6, 2022 01:07
@IanButterworth IanButterworth force-pushed the ib/profile_lazy_buffer branch from acd1fc0 to 4be4ea0 Compare August 6, 2022 02:55
@IanButterworth IanButterworth merged commit 72473ae into JuliaLang:master Aug 6, 2022
@IanButterworth IanButterworth deleted the ib/profile_lazy_buffer branch August 6, 2022 06:27
IanButterworth added a commit that referenced this pull request Aug 7, 2022
@KristofferC KristofferC removed the backport 1.8 Change should be backported to release-1.8 label Aug 7, 2022
ffucci pushed a commit to ffucci/julia that referenced this pull request Aug 11, 2022
pcjentsch pushed a commit to pcjentsch/julia that referenced this pull request Aug 18, 2022
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