agdsn / sipa

The Supreme Information Providing Application
MIT License
13 stars 10 forks source link

Performance improvements #476

Closed lukasjuhrich closed 11 months ago

lukasjuhrich commented 11 months ago

Some perf improvements regarding the flatpages extension. Relevant because these are loaded on every request (News & Navbar depend on that).

left to do:

lukasjuhrich commented 11 months ago

some hyperfine reports (not logged in, no session cookies) along these commits:

(sipa) ➜  sipa git:(305aa27) hyperfine --warmup=100 --runs=100 'curl -s http://localhost:5001/news/ -o /dev/null'

Benchmark 1: curl -s http://localhost:5001/news/ -o /dev/null
  Time (mean ± σ):      46.6 ms ±   3.6 ms    [User: 2.8 ms, System: 2.9 ms]
  Range (min … max):    42.9 ms …  66.5 ms    100 runs

  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.

(sipa) ➜  sipa git:(318da40) hyperfine --warmup=100 --runs=100 'curl -s http://localhost:5001/news/ -o /dev/null'

Benchmark 1: curl -s http://localhost:5001/news/ -o /dev/null
  Time (mean ± σ):      46.0 ms ±   8.1 ms    [User: 2.9 ms, System: 2.4 ms]
  Range (min … max):    40.3 ms …  90.2 ms    100 runs

  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.

(sipa) ➜  sipa git:(7ae0ed0) hyperfine --warmup=100 --runs=100 'curl -s http://localhost:5001/news/ -o /dev/null'

Benchmark 1: curl -s http://localhost:5001/news/ -o /dev/null
  Time (mean ± σ):      43.8 ms ±   2.9 ms    [User: 2.4 ms, System: 2.7 ms]
  Range (min … max):    40.3 ms …  61.9 ms    100 runs

  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.

(sipa) ➜  sipa git:(1020047) hyperfine --warmup=100 --runs=100 'curl -s http://localhost:5001/news/ -o /dev/null'

Benchmark 1: curl -s http://localhost:5001/news/ -o /dev/null
  Time (mean ± σ):      46.1 ms ±   7.6 ms    [User: 2.5 ms, System: 3.0 ms]
  Range (min … max):    40.6 ms …  99.7 ms    100 runs

  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.

(sipa) ➜  sipa git:(b18fc74) hyperfine --warmup=100 --runs=100 'curl -s http://localhost:5001/news/ -o /dev/null'

Benchmark 1: curl -s http://localhost:5001/news/ -o /dev/null
  Time (mean ± σ):      45.5 ms ±   8.5 ms    [User: 3.2 ms, System: 2.5 ms]
  Range (min … max):    40.0 ms … 121.2 ms    100 runs

  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.

(sipa) ➜  sipa git:(a57e33b) hyperfine --warmup=100 --runs=100 'curl -s http://localhost:5001/news/ -o /dev/null'

Benchmark 1: curl -s http://localhost:5001/news/ -o /dev/null
  Time (mean ± σ):      25.8 ms ±   2.7 ms    [User: 3.2 ms, System: 2.5 ms]
  Range (min … max):    22.6 ms …  43.7 ms    100 runs

  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.

(sipa) ➜  sipa git:(560f52e) hyperfine --warmup=100 --runs=100 'curl -s http://localhost:5001/news/ -o /dev/null'

Benchmark 1: curl -s http://localhost:5001/news/ -o /dev/null
  Time (mean ± σ):      12.8 ms ±   0.8 ms    [User: 3.3 ms, System: 2.4 ms]
  Range (min … max):    11.2 ms …  17.0 ms    100 runs