Open cmyr opened 2 years ago
I like. Buffer per thread?
yea, something like this. I'm not sure how best to do this with rayon
, though..
edit: looks possible, there are some tools for building custom threadpools with thread-local state etc.
This would also mean we'd need to stop allocating new sub-buffers while parsing?
what sub buffers do we allocate?
mm, that is a funny one, I didn't remember that. That would be unchanged, although in theory we could also have a reusable buffer for that. I don't see any others, do you?
That's probably the only one :)
just noticed this, but currently during parsing we allocate storage for each individual glyph that we parse. It would not be that hard to reuse a single allocation between parsings.
Ultimately this will not be a big win and we shouldn't lose too much sleep over it, but also it should be fairly easy and it shouldn't require breaking changes (at the very least we can just add API to do this internally when we're loading layers.)
One complication is how to share buffers between parsers across threads when we're loading in parallel. 🤔