Closed mrLSD closed 7 years ago
Hah, that's because the template for MemorySource in the example is significantly smaller and simpler than DirectorySource. Once you called reload
on HandlebarsEngine
, the templates will be loaded into memory and parsed, so there is no different between sources at runtime.
I done some research.My templates + layouts with really small logic significantly reduce perfomance, for example from 90k rps to 15k rps.It's 6x slower.My question: is it perfomance issue? 21.11.2016, 15:20, "Ning Sun" notifications@github.com:Hah, that's because the template for MemorySource in the example is significantly smaller and simpler than DirectorySource. Once you called reload on HandlebarsEngine, the templates will be loaded into memory and parsed, so there is no different between sources at runtime.—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or mute the thread.
I think this is reasonable. 90k rps is really really fast. At this level, any logic will add significant overhead to it. If you add some database logic to your handler, the overhead can be ignored.
And at the moment I haven't optimize render speed specifically. There is room for future improvement.
I will close this for now.
Is there way to use DirectorySource as MemorySource?
I tested: https://github.com/sunng87/handlebars-iron/blob/master/examples/server.rs
I saw perfomance issue - I/O.