Yesterday we built the last component of what I am calling TVLens version 1. Today, I wanted to focus on speed.
Here are a couple of things we did to make TVLens faster:
- I moved the cast and crew split onto the connection itself instead of recomputing it on every profile build. That recomputation was 53% of the time.
- I replaced a four-join query with two smaller ones. That one query was 77ms out of the 109ms the page spent in the database.
TVLens was executing at 579ms and it is now 49ms. That is the worst case, a profile that has rated every show in the catalog.
Neither fix was a cache. Both removed work.
I also used lint findings and ruff format to keep parts of the codebase from running long, and I had AI create fake profiles to test the recommender. That let me check assumptions I made early in the build.
We fixed the site header too, which was printing my name twice.