human-essentials
human-essentials copied to clipboard
4116 tune historical cache job
Resolves #4116
Description
For benchmark data used from https://github.com/rubyforgood/human-essentials/blob/main/spec/services/historical_trend_service_spec.rb
10.times do
puts Benchmark.measure { service.series }
end
HistoricalTrendService (before refactoring)
#series
0.039213 0.006921 0.046134 ( 0.051146)
0.044177 0.000000 0.044177 ( 0.048292)
0.037042 0.007520 0.044562 ( 0.049178)
0.040136 0.000152 0.040288 ( 0.044622)
0.052444 0.000000 0.052444 ( 0.057870)
0.042409 0.000000 0.042409 ( 0.047901)
0.042563 0.003807 0.046370 ( 0.051300)
0.039244 0.004777 0.044021 ( 0.048716)
0.039548 0.003961 0.043509 ( 0.048854)
0.042411 0.000000 0.042411 ( 0.047046)
HistoricalTrendService (after refactoring)
#series
0.005371 0.000344 0.005715 ( 0.006807)
0.002460 0.000000 0.002460 ( 0.003093)
0.002152 0.000172 0.002324 ( 0.003263)
0.002500 0.000000 0.002500 ( 0.003430)
0.002189 0.000190 0.002379 ( 0.002956)
0.002490 0.000000 0.002490 ( 0.003053)
0.002278 0.000000 0.002278 ( 0.002841)
0.002949 0.000000 0.002949 ( 0.003840)
0.002808 0.000000 0.002808 ( 0.003388)
0.003212 0.000000 0.003212 ( 0.003783)
Type of change
- Bug fix (non-breaking change which fixes an issue)
How Has This Been Tested?
- with unit tests