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

Use StringMemory instead of StringVector where possible #53962

Merged
merged 2 commits into from
Apr 5, 2024

Commits on Apr 5, 2024

  1. Use StringMemory to convert integer to string ~20% faster

    On `1.11.0-alpha2`
    Old:
    ```julia
    @benchmark Base.dec($0x1, $0, $false)
    BenchmarkTools.Trial: 10000 samples with 994 evaluations.
     Range (min … max):  33.702 ns …   4.242 μs  ┊ GC (min … max):  0.00% … 97.61%
     Time  (median):     37.626 ns               ┊ GC (median):     0.00%
     Time  (mean ± σ):   45.787 ns ± 147.794 ns  ┊ GC (mean ± σ):  14.53% ±  4.47%
    
        ▄▅▆▇█▇▇▅▃▃▂▂▂▁    ▁▂▁▁▁             ▁▁   ▁                 ▂
      ▄▇███████████████▇▇██████▇█▆▆▄▄▃▄▅▄▆▇████████▆▅▅▇▆▅▆▄▄▅▄▄▄▁▅ █
      33.7 ns       Histogram: log(frequency) by time      67.5 ns <
    
     Memory estimate: 88 bytes, allocs estimate: 3.
    ```
    New:
    ```julia
    BenchmarkTools.Trial: 10000 samples with 995 evaluations.
     Range (min … max):  27.538 ns …   3.397 μs  ┊ GC (min … max):  0.00% … 97.86%
     Time  (median):     30.151 ns               ┊ GC (median):     0.00%
     Time  (mean ± σ):   34.547 ns ± 105.101 ns  ┊ GC (mean ± σ):  10.37% ±  3.39%
    
           ▁ █▆▃  ▁
      ▂▂▃▃▅█████▆████▆▄▄▃▃▃▃▃▃▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▁▂▂▂▂▂▁▂▂▂▂▂▂▂▂▂▂▂▂▂ ▃
      27.5 ns         Histogram: frequency by time         43.8 ns <
    
     Memory estimate: 56 bytes, allocs estimate: 2.
    ```
    
    
    Fixes JuliaLang#53950, actually now even faster than `1.10.2`.
    Zentrik authored Apr 5, 2024
    Configuration menu
    Copy the full SHA
    6d4b192 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4b78a9d View commit details
    Browse the repository at this point in the history