Re: LayerLengthEv and NoCacheEvaluatable - Layer API issue

2023-08-16 Thread Steve Lawrence
I'm thinking the layer framework needs to allocate the layer transformer instance in a thread-local manner so that if it constructs mutable state that will be thread local also One downside to this is layer transformers that are thread-safe unnecessarily incur some amount of overhead, both in

Re: LayerLengthEv and NoCacheEvaluatable - Layer API issue

2023-08-16 Thread Mike Beckerle
In the CRC32 layer, the "optimization" was really just laziness. The use case we have only needs constant known explicit lengths, so we wanted to hard wire that, and not bother to support nor test any other cases. But, had that worked, I would bet we would have made the mistake and pre-allocated

Re: LayerLengthEv and NoCacheEvaluatable - Layer API issue

2023-08-16 Thread Steve Lawrence
I don't remember why NoCacheEvluatable was used, but you're I suspect you're right that it was done so implementations are less likely to mess things up. Note that NoCacheEvaluatable is also used for ImplicitLengthEv. I'm not sure why it's used there either. Maybe LayerLengthEv just copied