Skip to content
This repository has been archived by the owner on Jul 24, 2020. It is now read-only.

Catalog render takes forever #628

Merged
merged 7 commits into from
Jul 7, 2014
Merged

Catalog render takes forever #628

merged 7 commits into from
Jul 7, 2014

Conversation

squidgetx
Copy link
Contributor

My benchmarking has suggested that the catalog render is the largest source of slowdown when updating the cart. This is because of the large number of calls to .available? (one for every day for every eq model).

Suggested optimisation: since eventually every reservation is called to check .available, get all the data we need to work with in a single query instead of issuing many separate queries.

similarly refactor .available so it can issue one query for the date range it needs as opposed to gathering all reservations for each day in the date range.

@mnquintana mnquintana added this to the 3.4.0 milestone Jul 3, 2014
@squidgetx squidgetx modified the milestone: 3.4.0 Jul 3, 2014
@squidgetx squidgetx self-assigned this Jul 3, 2014
@squidgetx
Copy link
Contributor Author

#343 made some good progress on this, largely removing the dependence on dates. Still work to be done removing dependence on # of models

@squidgetx
Copy link
Contributor Author

1.1s and 1.2s, respectively using the same setup detailed in #343.

headshot

@squidgetx
Copy link
Contributor Author

3.3.0:
screenshot - 07072014 - 01 34 57 pm

screenshot - 07072014 - 01 36 34 pm

dgoerger added a commit that referenced this pull request Jul 7, 2014
Catalog render NO LONGER takes forever.
@dgoerger dgoerger merged commit 0c5d5df into development Jul 7, 2014
@dgoerger dgoerger mentioned this pull request Jul 7, 2014
@squidgetx squidgetx deleted the 628_refactor_catalog branch July 11, 2014 15:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants