[openstreetmap/openstreetmap-website] Cache social link platform and name at save time (PR #6950)
Pablo Brasero
notifications at github.com
Sat Jun 27 10:53:42 UTC 2026
pablobm left a comment (openstreetmap/openstreetmap-website#6950)
Following https://github.com/openstreetmap/openstreetmap-website/pull/7177, I thought I'd return to this PR to see what improvement can actually be measured using [derailed_benchmarks](https://github.com/zombocom/derailed_benchmarks).
TL;DR: the cache does improve the load speed of the page, by a small but measurable amount.
This time I used the command `perf:app`, which compares two versions of the code many many times and, by the might of smart statistics that escape my understanding, assures us that the measured difference is statistically significant. This is the result:
```
$ SHAS_TO_TEST="8741178e,0496f70b" PATH_TO_HIT=/user/mapper bundle exec derailed exec perf:app
Testing 1: 8741178e0: RESEARCH: remove cache to compare with derailed_benchmarks
Testing 2: 0496f70bd: DEBUG: perf:app appears to require derailed available in prod mode?
Sample: 1/200 iterations per sample: 200
(...a long time later...)
Sample: 200/200 iterations per sample: 200
Resetting git dir of '.' to "8741178e0"
❤️ ❤️ ❤️ (Statistically Significant) ❤️ ❤️ ❤️
[8741178e0] (6.7650 seconds) "RESEARCH: remove cache to compare with derailed_benchmarks" ref: "8741178e"
SLOWER 🐢🐢🐢 by:
0.9666x [older/newer]
-3.4524% [(older - newer) / older * 100]
[0496f70bd] (6.5393 seconds) "DEBUG: perf:app appears to require derailed available in prod mode?" ref: "0496f70b"
Iterations per sample: 200
Samples: 200
Test type: Kolmogorov Smirnov
Confidence level: 99.0 %
Is significant? (max > critical): true
D critical: 0.15174271293851463
D max: 0.38
Histograms (time ranges are in seconds):
[8741178e0] description: [0496f70bd] description:
"RESEARCH: remove cache to compare with derailed_benchmarks" "DEBUG: perf:app appears to require derailed available in prod mode?"
┌ ┐ ┌ ┐
[ 6.0, 8.0) ┤▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 171 [ 6.0, 8.0) ┤▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 175
[ 8.0, 10.0) ┤▇▇▇ 17 [ 8.0, 10.0) ┤▇▇▇ 16
[ 9.0, 11.0) ┤ 2 [ 9.0, 11.0) ┤ 0
[11.0, 13.0) ┤ 0 [11.0, 13.0) ┤ 0
[12.0, 14.0) ┤ 0 [12.0, 14.0) ┤ 0
[14.0, 16.0) ┤ 2 [14.0, 16.0) ┤▇ 4
[15.0, 17.0) ┤▇ 7 [15.0, 17.0) ┤▇ 5
[17.0, 19.0) ┤ 1 [17.0, 19.0) ┤ 0
└ ┘ └ ┘
# of runs in range # of runs in range
```
(The SHAs above don't exist in the repo, they were only local to me while I was putting together the benchmark. Also I had to work around what I think is a bug in derailed_benchmarks in order to make it work. I'll file an issue upstream).
The test above is for a profile with 3 social links. In that context, in my Debian Thinkpad, the non-cached version runs at 0.9666x the speed of the cached version, or -3.4524% slower.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6950#issuecomment-4816921668
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/6950/c4816921668 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260627/0043a6f8/attachment-0001.htm>
More information about the rails-dev
mailing list