Handlebars-Net/Handlebars.Net

Static Handlebars instance thread safety

RohanChhipa opened this issue · 2 comments

Hi ☺️

Regarding the static instance of handlebars, is it possible to observe blocking behaviour when that instance is accessed with multiple threads?

During our load test for our web API, we're seeing some Compiles going through while some aren't. We're actually looking into possibly creating a new instance for each request that comes through but also just wanted to have a forum around whether or not there have been multi-threading issues with the static instance.

Hello @RohanChhipa
I'm not aware of any such issues. I'd be happy to help you with the investigation and fixing the problem if one found.

Btw, why are you doing Compile on each request? This operation is pretty expensive. Have you thought on reusing compiled templates?

Might be related to #498