Skip to content

Full asynchronous template engine #2

@vegaelle

Description

@vegaelle

It seems that template engines (particularly Jinja2) is not a performance bottleneck, but as for now, controllers and views (as in “MVC”) are executed sequencially.

In a full async framework, the template engine could do its job as soon as possible: for example, when setting up the template renderer, it could compile and render the template immediately, and define futures for missing variables. Back to the controller, when we get those variables, we update the response context (that is passed to the template renderer), and the missing parts of the template gets renderered as well. That way, after the controller execution, the template is normally already rendered (or at least most of it). This could speed up the HTTP request processing.

Here is a schema describing this feature (comments are in french)
lazy_templating

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions