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

Add very basic precompilation #40

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add very basic precompilation #40

wants to merge 2 commits into from

Conversation

mortenpi
Copy link
Member

@mortenpi mortenpi commented Apr 1, 2025

Shaves about 50% off the basic PkgAuthentication.authenticate("example.com") call (1.1s -> 0.5s on my setup) if you already have the token. Before:

BenchmarkTools.Trial: 5 samples with 1 evaluation per sample.
 Range (min … max):  1.133 s …   1.172 s  ┊ GC (min … max): 0.00% … 0.00%
 Time  (median):     1.155 s              ┊ GC (median):    0.00%
 Time  (mean ± σ):   1.153 s ± 14.355 ms  ┊ GC (mean ± σ):  0.00% ± 0.00%

  █                █             █     █                  █
  █▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█▁▁▁▁▁▁▁▁▁▁▁▁▁█▁▁▁▁▁█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█ ▁
  1.13 s         Histogram: frequency by time        1.17 s <

 Memory estimate: 1.33 KiB, allocs estimate: 46.

After:

BenchmarkTools.Trial: 10 samples with 1 evaluation per sample.
 Range (min … max):  516.547 ms … 546.332 ms  ┊ GC (min … max): 0.00% … 0.00%
 Time  (median):     530.276 ms               ┊ GC (median):    0.00%
 Time  (mean ± σ):   531.262 ms ±  12.163 ms  ┊ GC (mean ± σ):  0.00% ± 0.00%

  ▁▁    ▁    ▁          ▁          ▁                ▁   ▁     █  
  ██▁▁▁▁█▁▁▁▁█▁▁▁▁▁▁▁▁▁▁█▁▁▁▁▁▁▁▁▁▁█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█▁▁▁█▁▁▁▁▁█ ▁
  517 ms           Histogram: frequency by time          546 ms <

 Memory estimate: 1.33 KiB, allocs estimate: 46.

I didn't really check the interactive case, but I don't think it's that important, since it will prompt for user input anyway.

@mortenpi mortenpi requested a review from pfitzseb April 1, 2025 04:26
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.

1 participant