superseriousbusiness / gotosocial

Fast, fun, small ActivityPub server.
https://docs.gotosocial.org
GNU Affero General Public License v3.0
3.84k stars 336 forks source link

[performance] convert enum strings to ints #3558

Open NyaaaWhatsUpDoc opened 2 days ago

NyaaaWhatsUpDoc commented 2 days ago

Description

This helps improve performance by reducing the amount that these enums take-up in disk-space in their respective tables, and improves performance (however minorly) by reducing memory impact of models requiring only int enums instead of strings and also simplifying the comparisons between values of these types.

However, on larger databases this will likely be a monstrously large migration given the nature of it and it acting on the largest table we have, statuses :')

Checklist

tsmethurst commented 1 day ago

Looking good!