Skip to content

calculate CAN_SIGSYS when called rather than as a constant#1032

Merged
exodist merged 1 commit intoTest-More:masterfrom
haarg:no-can-sigsys
Mar 29, 2025
Merged

calculate CAN_SIGSYS when called rather than as a constant#1032
exodist merged 1 commit intoTest-More:masterfrom
haarg:no-can-sigsys

Conversation

@haarg
Copy link
Copy Markdown
Member

@haarg haarg commented Mar 29, 2025

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.

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.
@exodist
Copy link
Copy Markdown
Member

exodist commented Mar 29, 2025

So this will speed up Test2, but slow down Test2::Harness?

@exodist
Copy link
Copy Markdown
Member

exodist commented Mar 29, 2025

Oh, nevermind, I see how it works, it does cache it, so it should not be slower for Test2::Harness.

@exodist exodist merged commit 8ec366b into Test-More:master Mar 29, 2025
19 checks passed
@haarg
Copy link
Copy Markdown
Member Author

haarg commented Mar 29, 2025

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.

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.

2 participants