Skip to content

get/set precompiled source/offset #118

Closed
wants to merge 6 commits into from

2 participants

@ghost
ghost commented Nov 30, 2011

hello.

added #precompile to get compiled template and offset.
then, on engine initialization, if passed block returns an array, it
will be used as precompiled/offset.

useful on caching scenarios, when template should be compiled and stored as string,
then later rendered by another engine instance without being complied.

in case my changes does not look suitable, maybe other ideas how to accomplish this?

thank you.

slivu get/set precompiled source/offset
use #precompile to get compiled template and offset.
then, on engine  initialization, if passed block returns an array, it
will be used as precompiled/offset.
519fba0
@ghost
ghost commented Dec 2, 2011

Ryan? Anyone?
Using this method shows real performance gaining - about 40% on 3 production environments.
Beside performance, on multiple processes scenarios, all processes will use same precompiled source(distributed by a fast db), making dead easy to update content for all at once and avoiding redundant template compiling by each process.

slivu sync 1c7b561
@apeacox
apeacox commented Dec 27, 2011

+1 this feature is very useful (I'd need to render a template by passing it as a String instead of a File)

@aemadrid

+1

@ghost ghost closed this May 17, 2012
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.