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

with_logger(NullLogger()) allocates in v1.11 #55761

Open
rfourquet opened this issue Sep 12, 2024 · 2 comments
Open

with_logger(NullLogger()) allocates in v1.11 #55761

rfourquet opened this issue Sep 12, 2024 · 2 comments
Labels
kind:regression Regression in behavior compared to a previous version logging The logging framework performance Must go faster regression 1.11

Comments

@rfourquet
Copy link
Member

This is a regression from v1.10, but OK to close if considered normal.

julia> using Logging; f() = with_logger(NullLogger()) do
           @debug "f"
       end

julia> @allocations f(); @allocations f()
8 # was 0 on v1.10

NullLogger() was useful to make logging macros essentially free when not used.
A workaround is to use Logging.disable_logging(Logging.Debug).

@rfourquet rfourquet added the logging The logging framework label Sep 12, 2024
@nsajko
Copy link
Contributor

nsajko commented Sep 13, 2024

Caused by #53584.

@nsajko nsajko added performance Must go faster kind:regression Regression in behavior compared to a previous version regression 1.11 labels Sep 13, 2024
@EdsterG
Copy link

EdsterG commented Sep 13, 2024

Number of allocations seems to grow with the number of calls to @debug.

julia> using Logging; f() = with_logger(NullLogger()) do
            for i=1:100
               @debug "f"
            end
       end

julia> @allocations f(); @allocations f()
206  # is 0 on v1.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:regression Regression in behavior compared to a previous version logging The logging framework performance Must go faster regression 1.11
Projects
None yet
Development

No branches or pull requests

3 participants