Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Out of curiosity - Performance #14

Open
jonathan-s opened this issue Dec 1, 2020 · 2 comments
Open

Out of curiosity - Performance #14

jonathan-s opened this issue Dec 1, 2020 · 2 comments

Comments

@jonathan-s
Copy link

There is a similar library for rails -> https://viewcomponent.org/ (https://github.com/github/view_component) Apparently that library is 10x faster in rendering than partials, which is the equivalent of django's include.

Do you have any idea what the performance characteristics are for this library?

@EmilStenstrom
Copy link
Owner

EmilStenstrom commented Dec 2, 2020

@jonathan-s That is a great question. I haven't done any benchmarking, but I would expect similar performance metrics as using a normal include. This would be easy to test I think. If you have a template that includes something in a loop, maybe several steps deep, and then at the bottom level, you put an {% include %} and measure performance. Then you replace the bottom level include with a {% component %} call, and compare the loading time.

The motivation for this library was not performance, but rather developer ergonomics in working with components. That said, I would happily accept patches that 1) adds a benchmark and 2) improve performance.

@EmilStenstrom
Copy link
Owner

I think we should add a benchmark test in the form of a python script that renders a complex template 1000 times, first with include and then with component, and compares the results. If anyone is able to contribute such a script I'd gladly merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants