I found the freezing culprit – it’s autosaving. Thanks to all who replied to the earlier post!
With all the recent additions, mostly since 1.12, saving got a little out of hand and I failed to spot it. I have now optimized it heavily and brought it down to a fraction of time it takes in 1.15. In one of the worlds I was sent (thanks!), autosaving took around 500ms. Now it takes 20ms. And all autosaving file access is now done on a background thread.
I had to make some compromises here and there to get it down. For example in 1.16 if you don’t visit your animals for a very long time (many game days) they will eventually disappear, even if totally enclosed (visiting means coming within ~16 blocks). This is required to keep the amount of animals data at bay.
Plus autosave now happens every 20 seconds, not 10 as before.