Closed
Description
Lots of low-hanging fruit to improve performance and efficiency. Basically we just need to set up a query log, do every action possible on the forum, and then inspect each query individually and optimize where it's not too hard.
Also add SQL indexes (we don't have any currently apart from primary keys).
There are some more interesting cases too, like:
- Flarum\Forum\Actions\IndexAction line 58: we send an API request to get the current user, but we already have the user data; we just want it formatted in an API response. We could technically call a serializer directly, but then we don't quite get all of the response features (like sideloaded data), and also Forum would depend on Api. I don't think we can optimize this case.
- Flarum\Core\Repositories\EloquentPostRepository (see big comment at top of file)