uhppoted / uhppoted-httpd

Browser based user interface for an access control system based on the UHPPOTE TCP/IP controllers
Other
4 stars 1 forks source link

UI is unusably slow with 100+ cards #43

Closed uhppoted closed 2 months ago

uhppoted commented 3 months ago

Ref. https://github.com/uhppoted/uhppoted-httpd/discussions/34#discussioncomment-10423271

With 100+ cards the user interface is sluggish to the point of being unusable:

twystd commented 2 months ago

Baseline performance with 200 cards:

Screenshot 2024-09-09 at 10 15 31 Screenshot 2024-09-09 at 10 17 07
twystd commented 2 months ago

With basic 'query' cache:

Screenshot 2024-09-09 at 11 09 29 Screenshot 2024-09-09 at 11 09 38
twystd commented 2 months ago

With cached query and query modified:

Screenshot 2024-09-10 at 11 38 32
twystd commented 2 months ago

rollback-all:

Screenshot 2024-09-13 at 09 28 29
twystd commented 2 months ago

rollback-all (with caching):

Screenshot 2024-09-13 at 10 40 39
twystd commented 2 months ago

rollback-all (modified only):

Screenshot 2024-09-13 at 10 58 30
twystd commented 2 months ago

With UI optimizations:

Screenshot 2024-09-20 at 12 16 46

Network call is now the bottleneck.

twystd commented 2 months ago

Slow network call is the consequence of evaluating grules for the 1000+ objects that make up the cards list for 200+ cards.

twystd commented 2 months ago

Caching grules CanView evaluations reduces initial network call to 600ms and subsequent calls to 50ms. Initial load time is now below 2s.

Screenshot 2024-09-24 at 10 39 47
uhppoted commented 2 months ago

Implemented prefetch on page load to fetch first page of cards:

Screenshot 2024-10-01 at 11 24 30 Screenshot 2024-10-01 at 11 25 03 Screenshot 2024-10-01 at 11 26 08
uhppoted commented 2 months ago

Initial time to load reduced to ~500ms - closing this as 'good enough for now' and deferring virtual lists to a separate issue (https://github.com/uhppoted/uhppoted-httpd/issues/45).