rosshamish / classtime

university schedule generation and course data API
MIT License
16 stars 2 forks source link

Front-end Profiling #62

Closed ahoskins closed 9 years ago

ahoskins commented 9 years ago

Did some profiling of the front-end tonight. The heaviest lifting is in the Accordion Controller (not surprising at all!):

  1. The block of code that processes the /api/courses-min response is the slowest by far. It takes about 500ms. (Note: the way the ms is written in this picture is confusing without the whole image)

screen shot 2014-11-20 at 10 47 40 pm

This is the section I will be giving a complete overhaul this weekend (most likely). We'll see how it improves.

  1. The filter and memoization wrapper is also a bit of a bottleneck. It takes around 500ms as well.

screen shot 2014-11-20 at 10 51 01 pm

Overall, it takes about 1600ms for the page to load. So 2/3 of this is spent in the two sections mentioned above.

rosshamish commented 9 years ago

FYI, a side effect of fixing the api/courses-min-structured call is that courses come back in sorted order now. So it is somewhat related to performance since you don't have to sort client-side anymore - it's done server-side.

ahoskins commented 9 years ago

I will give an update on this (using the new structure) tomorrow or the next day. And then this issue will be closed.

rosshamish commented 9 years ago

This is probably good to close. The compareTo isn't being used anymore (since its sorted server-side now), and the filter is way different now anyway.