calculate CAN_SIGSYS when called rather than as a constant#1032
Merged
exodist merged 1 commit intoTest-More:masterfrom Mar 29, 2025
Merged
calculate CAN_SIGSYS when called rather than as a constant#1032exodist merged 1 commit intoTest-More:masterfrom
exodist merged 1 commit intoTest-More:masterfrom
Conversation
CAN_SIGSYS is not used by Test2 anymore since the removal of the shm code in 4c1bdd2. It is however still used by Test2::Harness. %Config has magic behavior where some values exist in Config.pm, and others need to load Config_heavy.pl. Checking the sig_name value will always force Config_heavy.pl to be loaded. Since CAN_SIGSYS is mostly not used, having it always force loading the heavy config provides a minor slowdown of loading Test::More. We can provide the function as a runtime check rather than a constant to avoid this.
Member
|
So this will speed up Test2, but slow down Test2::Harness? |
Member
|
Oh, nevermind, I see how it works, it does cache it, so it should not be slower for Test2::Harness. |
Member
Author
|
It's also only used by App::Yath::Plugin::SysInfo, so it would basically never be called more than once. And it serves little use in that plugin and could probably be removed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CAN_SIGSYS is not used by Test2 anymore since the removal of the shm code in 4c1bdd2. It is however still used by Test2::Harness.
%Config has magic behavior where some values exist in Config.pm, and others need to load Config_heavy.pl. Checking the sig_name value will always force Config_heavy.pl to be loaded. Since CAN_SIGSYS is mostly not used, having it always force loading the heavy config provides a minor slowdown of loading Test::More. We can provide the function as a runtime check rather than a constant to avoid this.