Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: gohugoio/hugo
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 7c4cbfdea2db14e9f285058dc6257835a160b8d7
Choose a base ref
...
head repository: gohugoio/hugo
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: a554c3843fcf4e7eb654a291a863a21c824e5b89
Choose a head ref
  • 1 commit
  • 4 files changed
  • 1 contributor

Commits on Oct 27, 2025

  1. hreflect: Cache reflect method lookups used in collections.Where and …

    …others
    
    We already cached the method index on the struct, but caching the resolved `reflect.Method` itself saves us from having to do another lookup on each call, which is escpeciall import in the hot path used by collections.Where and otherrs:
    
    ```bash
                                            │ master.bench │    fix-reflectmethodcache.bench     │
                                            │    sec/op    │    sec/op     vs base               │
    WhereSliceOfStructPointersWithMethod-10   592.2µ ± ∞ ¹   390.1µ ± ∞ ¹  -34.14% (p=0.029 n=4)
    ¹ need >= 6 samples for confidence interval at level 0.95
    
                                            │  master.bench  │     fix-reflectmethodcache.bench     │
                                            │      B/op      │     B/op       vs base               │
    WhereSliceOfStructPointersWithMethod-10   205.14Ki ± ∞ ¹   64.52Ki ± ∞ ¹  -68.55% (p=0.029 n=4)
    ¹ need >= 6 samples for confidence interval at level 0.95
    
                                            │ master.bench │    fix-reflectmethodcache.bench     │
                                            │  allocs/op   │  allocs/op    vs base               │
    WhereSliceOfStructPointersWithMethod-10   9.003k ± ∞ ¹   4.503k ± ∞ ¹  -49.98% (p=0.029 n=4)
    ````
    bep committed Oct 27, 2025
    Configuration menu
    Copy the full SHA
    a554c38 View commit details
    Browse the repository at this point in the history
Loading