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

Make benchmarks more realistic #49

Closed
lambda-fairy opened this issue Oct 9, 2016 · 6 comments
Closed

Make benchmarks more realistic #49

lambda-fairy opened this issue Oct 9, 2016 · 6 comments
Labels

Comments

@lambda-fairy
Copy link
Owner

The existing benchmarks are okay, but a bit simplistic. I'd love to have code that reflects the kind of use cases we see in the real world.

@lambda-fairy
Copy link
Owner Author

@TheNeikos would you be interested in this issue? I know you're working on a website that uses Maud; that project could be a good source to draw from.

@TheNeikos
Copy link
Contributor

Hm, right now I'm doing something similar to Rails (cause I like their way of organizing things):

  • controller calls view with data
  • view computes it with html! which usually includes several other components that call html!
  • it is all passed to a layout that then outputs the whole thing

I wouldn't mind generalizing it a bit and making a benchmark for it, although I am not sure what one would benchmark in that case. Nested html!? (Because benchmarking my way of doing it would be out of scope of Maud think)

@lambda-fairy
Copy link
Owner Author

It's great that you're interested in this sort of thing!

My goals with these benchmarks are twofold:

  1. To give me something more realistic to benchmark against, so I don't optimize myself into a hole. We had that weird issue with inlining before, and I suspect that a larger benchmark would have been more helpful for that.
  2. To compare approaches with other template engines.

Horrorshow, in particular, still uses a method based on writers/closures, rather than returning a String as Maud does today. We only see a difference in the two approaches when we start including templates in other templates (I think that's what you mean by nested html!?). One of the reasons I switched to Strings was to make use cases like yours more convenient, so I'd like to see how it compares performance-wise.

In other words, benchmarking your way of doing it is not out of scope. I think copying the code from a reasonably-complex view, and calling it would some hard-coded data, would make a decent benchmark.

@TheNeikos
Copy link
Contributor

Alright, I will do that then. 👍

@TheNeikos
Copy link
Contributor

TheNeikos commented Oct 17, 2016

Hm... Sorry that I didn't come back to you yet. I forgot to put it on my to-do list and it slipped my mind. It is there now though, so you should get the start of a PR tonight (GMT+2 once I'm home from work).

@lambda-fairy
Copy link
Owner Author

I don't think there's anything else to do for this issue.

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

No branches or pull requests

2 participants