Thursday, April 18, 2024
1 change · 17.0
Enhancements to existing features
This update significantly speeds up the appointment booking system, particularly when managing multiple resources and capacity changes. The system now processes slot availability checks 5-7 times faster, reducing wait times from several seconds to under a second when updating booking capacities. This improvement enhances the user experience when managing complex appointment scenarios with many linked resources.
Original PR description
- Compute the best resources for a slot only for distinct capacity info and improve performance when updating table booking from 1 to 12 capacities with appointment type with a lot of linked…
- Compute the best resources for a slot only for distinct capacity info and
improve performance when updating table booking from 1 to 12 capacities
with appointment type with a lot of linked resources (tested on Table Booking
without any event booked):
Before: ~105s (local time)
After: ~15s (local time)
This also allows the first slot computation to be a little faster (4s => 3s)
- Don't use intervals_overlap in _slot_availability_is_resource_available:
~15s => ~4s (local time)
It was called a lot because of the default resource calendar and the work intervals
computed from it.
- Single filtered on booking lines for _get_resources_remaining_capacity
Queries count (from profiler - local):
/appointment/4 : ~1500 => ~830
/appointment/4/update_available_slots (capacity -> 12) : ~7700 => ~455
/appointment/4/update_available_slots (capacity 12 -> 1) : ~1130 => ~430
/appointment/4/update_available_slots (capacity 1 -> 12) : ~7700 => ~455
Queries count (profiler - runbot):
/appointment/4/update_available_slots (capacity -> 12) : ~1190 => ~130
task-3640599