• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pulibrary / orangelight / 7667d2fe-198b-464a-81fd-eee9a4ffbd98
95%
main: 95%

Build:
Build:
LAST BUILD BRANCH: remove-unused-methods-3913
DEFAULT BRANCH: main
Ran 01 Nov 2025 02:39PM UTC
Jobs 1
Files 223
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

01 Nov 2025 02:25PM UTC coverage: 95.417% (+0.001%) from 95.416%
7667d2fe-198b-464a-81fd-eee9a4ffbd98

push

circleci

sandbergja
Memoize Bibdata.holding_locations in some helpers

It can take quite some time to read and parse the holding locations from the disk cache.
This can be seen as a bottleneck on both the advanced search form and the search results
page.  Therefore, we should strive not to do this expensive process more than once per
request.

On the advanced form, where the #render_location_code helper method is called once for
every location in the solr index, memoizing Bibdata.holding_locations has a significant
performance gain.  Just running this locally, the server responds with the advanced
search form in half the time!

Microbenchmark before:
```
$ be ruby benchmarks/app/helpers/application_helper.rb
ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +YJIT +PRISM [arm64-darwin24]
Warming up --------------------------------------
ApplicationHelper#render_location_code
                        87.000 i/100ms
Calculating -------------------------------------
ApplicationHelper#render_location_code
                        882.392 (± 1.6%) i/s    (1.13 ms/i) -      4.437k in   5.029587s
```

After:
```
ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +YJIT +PRISM [arm64-darwin24]
Warming up --------------------------------------
ApplicationHelper#render_location_code
                       127.558k i/100ms
Calculating -------------------------------------
ApplicationHelper#render_location_code
                          1.280M (± 1.0%) i/s  (781.40 ns/i) -      6.505M in   5.083919s
```

5 of 6 new or added lines in 1 file covered. (83.33%)

6205 of 6503 relevant lines covered (95.42%)

1462.93 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
91.79
0.12% app/helpers/application_helper.rb
Jobs
ID Job ID Ran Files Coverage
1 7667d2fe-198b-464a-81fd-eee9a4ffbd98.1 01 Nov 2025 02:39PM UTC 223
95.42
Source Files on build 7667d2fe-198b-464a-81fd-eee9a4ffbd98
  • Tree
  • List 223
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • CircleCI Build #7667D2FE...
  • d53be40a on github
  • Prev Build on main (#D41B6AA3...)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc