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
Question: define! vs new! #12
Comments
Well, |
Hi @diegopy, Yes, there's a performance difference - I personally use whichever makes more sense in the situation, without considering the performance difference. The primary reason to choose one over the other: |
@ZaneHannanAU I'm not sure I understand your example. You can accept generic template with markup::define! {
Doc<Head: markup::Render, Body: markup::Render>(h: Head, b: Body) {
head { @h }
body { @b }
}
} Did you mean something else? |
Thanks for your detailed reply, very clear. |
Hi team,
First, thanks for this library. The impressive benchmark result is making me move from Maud to this, although I'm not very experienced with either.
Me question is regarding define! vs new! macro use, like in the fortunes.rs example. I tend to prefer new! here, and have functions wrapping the template, so my question is: Is there any disadvantage (in performance or otherwise) of new! vs define!? Any advice on which one will scale better once the number of templates (and the references between them) scales as the application grows?
Thanks
The text was updated successfully, but these errors were encountered: