-
Notifications
You must be signed in to change notification settings - Fork 136
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
Rendering with data #83
Comments
See here for changes which are needed: |
I'm (pleasantly) surprised that you need this kind of performance. If you can provide a backwards compatible implementation with some test/examples to show the increased performance, I would be happy to merge it. |
@kicktipp I'm planning to release a new version soon, do you want this included? |
I will need a few weeks to evaluate it. Release fast, release often. So go
ahead.
Am 27. November 2017 19:45:06 schrieb David <notifications@github.com>:
… @kicktipp I'm planning to release a new version soon, do you want this
included?
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#83 (comment)
|
j2html is great, easy and fast. But I think it could be even faster and consume less memory with the following approach. Maybe it is not a good idea so I am asking for feedback here first.
Take a look at this code:
This template generates the DomContent each and every time I render this page. This involves - with a bigger template - a lot of
new ContainerTag
statements (which are hidden by static imports).It would be nice to build a DomContent Tree with some self written ContainerTags first and then let it render with a model.
Therefor we need a second render method
render(Object model)
. The model is passed down the line and each Tag or Attribute can pick up its model if needed for rendering. Object would usually be a map like in Spring MVC.This way I can reuse the DomContent for each and every page. I don't need to build it and I don't need the GC to collect it.
This would be fairly easy when we add two methods to DomContent (and one method to Attribute)
If you think this is a good idea I can send a patch request.
The text was updated successfully, but these errors were encountered: