PlaidWeb / Publ

Flexible publishing system for the web
http://publ.beesbuzz.biz/
MIT License
40 stars 4 forks source link

Replace overwrought database ACL test with simple string parsing #578

Closed fluffy-critter closed 1 month ago

fluffy-critter commented 1 month ago

Summary

Just parse the entry ACL rules from a string instead of trying to be too fancy in the database

Detailed description

Profiling my website found that a large amount of the template render time was spent in the pagination, and that in turn was spending a large amount of time processing the permission ACL, which in turn required a lot of overly-complicated database access. There is no reason for this to be in the database when it's faster to just parse the ACL string directly instead of having to do a lot of marshaling, indexing, and so on.

Developer/user impact

Bumps the schema, so sites will have to reindex.

Test plan

Thoroughly tested using the auth/ test suite.

Got a site to show off?

fluffy-critter commented 1 month ago

This doesn't actually make a measurable performance impact (I grievously misinterpreted the profiler output that led me to do this work) but it's still an improvement overall, as it reduces the complexity of the schema, removes an index, and makes the indexer a bit simpler as well. So I'm still making this change.