Skip to content

[FastAPI] Homepage: Add authenticated dashboard

Kevin Morris requested to merge kevr/aurweb:pu_dashboard into pu

This MR depends on !116 (merged) being merged in; please address reviewing that first.

** Authenticated Dashboard **
[FastAPI w/ Redis; 6 packages owned by AURSID]
Benchmark #1: curl --cookie AURSID=09pioosjatzzfljzs3cos8l0mx9n137c https://localhost:8444
  Time (mean ± σ):      38.7 ms ±   7.4 ms    [User: 8.1 ms, System: 2.4 ms]
  Range (min … max):    35.3 ms …  96.6 ms    500 runs
 
[PHP w/ Memcached; 6 packages owned by AURSID]
Benchmark #1: curl --cookie AURSID=09pioosjatzzfljzs3cos8l0mx9n137c https://localhost:8443
  Time (mean ± σ):     195.0 ms ±  14.6 ms    [User: 8.3 ms, System: 2.4 ms]
  Range (min … max):   183.0 ms … 251.2 ms    500 runs
 
That being said, I have previously noticed that PHP could actually win
on higher counts of Package objects (when there's about 150 packages fetched
for result tables), due to how we fetch the Notified and Voted states of each
Package. An issue should be created for this and worked on.

# With a worst-case scenario: 150 packages found through database,
# PHP does currently win.

[FastAPI]
Benchmark #1: curl --cookie AURSID=240aqj4s94m4v6r1w2ckpjl7sdf33ls3 https://localhost:8444
  Time (mean ± σ):     217.9 ms ±  11.7 ms    [User: 8.3 ms, System: 2.4 ms]
  Range (min … max):   204.9 ms … 434.8 ms    500 runs
 
[PHP]
Benchmark #1: curl --cookie AURSID=240aqj4s94m4v6r1w2ckpjl7sdf33ls3 https://localhost:8443
  Time (mean ± σ):     192.4 ms ±  13.8 ms    [User: 8.4 ms, System: 2.2 ms]
  Range (min … max):   182.8 ms … 259.4 ms    500 runs

For now, this is good for the majority of situations, but an issue should be opened to address the shortcomings of the gigantic request situation.

Edited by Kevin Morris

Merge request reports