This is sample AI based chat app created for assignment.
Local Performance Analysis:
- Seeding process : Before optimisation: 175.08924500000285 seconds || After optimisation: 17.734820999998192 seconds
- Profile index page: Before optimisation: 20.0ms || After optimisation: 11.3ms
- Profile index page with gender filter: Before optimisation: 17.6ms || After optimisation: 5.8ms
- Profile index page with category filter: Before optimisation: 18.1ms || After optimisation: 7.5ms
- Profile index page with gender and category filter: Before optimisation: 20.8ms || After optimisation: 17.8ms
- Chat index db execution: Before optimisation: 1.7 ms || After optimisation: 1.6ms
code branch before optimisation branch: before_db_optimization
Used Benchmark & middleware default execution time logger.
Optimazation steps taken:
- Added index to Profiles table for gender & category columns since its used in UI filter action.
- Added batch level of seeding process for profile load instead active record create logic.
- Added index to Messages table for role column & already user_id index added through user table reference instruction.
- Added bullet gem to track any N+1 query execution & tracking long query execution in this app.
- Pagination was already added to Profile index page.

