Skip to content

Conversation

@zspitzer
Copy link
Owner

The current templating approach is really inefficient, as it recursively loops thru every
passed available variable for substituion and applies a regex for each one.

It's much faster to initially parse the template and then only process those strings which are
actually present in the template.

This revised implementation both caches the parsed templates and then only processes the string which are present.

The performance improvement is quite drastic, especially with large tables. A large table was previously taking 15s to render
in Chrome, now takes less than 1s with this approach

The current templating approach is really inefficient, as it recursively loops thru every 
passed available variable for substituion and applies a regex for each one. 

It's much faster to initially parse the template and then only process those strings which are 
actually present in the template.

This revised implementation both caches the parsed templates and then only processes the string which are present.

The performance improvement is quite drastic, especially with large tables. A large table was previously taking 15s to render 
in Chrome, now takes less than 1s with this approach
@zspitzer zspitzer closed this Sep 15, 2016
@zspitzer zspitzer reopened this Sep 15, 2016
@zspitzer zspitzer merged commit bf2ac3d into master Sep 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants