Please pull the latest changes from my master when you've finished editing your pull request.
ExecuteBuffer for that case if you already know the size of your result
ExecuteBuffer for that case if you already know the size of your rendered template. In some cases it can save up to 28% of execution time.
- 点赞 评论 复制链接分享
Oh sorry, I did not know that I still able to commit to this pull request. Now I am done ;)点赞 评论 复制链接分享
Thanks, I've merged this.点赞 评论 复制链接分享
However, after thinking about it it might be redundant with
ExecuteWriter(). Maybe I change some of the internals to allow use
ExecuteWriter()for such situations and to prevent any buffer allocation. Would be the preferred way to go I believe because it would speed up almost any template generation and does not require any prediction on the expected output size. Anyway, for the meantime your proposed API is commited.点赞 评论 复制链接分享
Thank you! This request helped us reduce the number of memory allocation, and increased the speed of template rendering.点赞 评论 复制链接分享
Maksim, you might want use
Template.ExecuteWriterUnbuffered()now. I changed a lot inside to make it more performant.点赞 评论 复制链接分享
Great job! I will check everything, hope now I will have more performance with lest memory allocations. Thank you点赞 评论 复制链接分享
You can use
ExecuteWriterUnbuffered()in combination with the http.ResponseWriter; no buffers needed. Let pongo2 directly write to the connection via ResponseWriter. Should give you maximum performance without having a buffer in between.点赞 评论 复制链接分享