Opened 18 years ago
Closed 18 years ago
#96 closed enhancement (fixed)
Improvement of basic benchmark
Reported by: | cito@… | Owned by: | cmlenz |
---|---|---|---|
Priority: | minor | Milestone: | 0.4.1 |
Component: | Examples / Benchmarks | Version: | 0.3.6 |
Keywords: | Cc: |
Description
I suggest to set up the data dictionary only one time for every engine, and outside the render() function, so the benchmark measures only the actual rendering.
Also, the Kid template module should not be loaded in the render() function only, but in advance, in order to have a fair comparison with Genshi. Though this is not the actual reason why Kid compares slower, it still makes a measurable difference.
I have changed both issues in the attached patch. Please make sure I haven't broken anything because I haven't installed and tested with all of the other engines.
Attachments (1)
Change History (4)
Changed 18 years ago by cito@…
comment:1 Changed 18 years ago by cmlenz
- Milestone changed from 0.4 to 0.4.1
Thanks for the feedback, I'll try to take a closer look at the benchmarks for 0.4.1.
comment:2 in reply to: ↑ description Changed 18 years ago by cmlenz
- Status changed from new to assigned
Replying to cito@online.de:
I suggest to set up the data dictionary only one time for every engine, and outside the render() function, so the benchmark measures only the actual rendering.
Setting up the template data in the timed loop is intentional, for a number of reasons:
- It's the way templating is commonly used: you set up a different set of data for each render
- Some template engines don't simply accept a dictionary, but require conversion of the data. This is the case for ClearSilver, which requires populating a “HDF” structure.
- Engines that don't have proper separation of compilation and render stages are punished ;-)
Also, the Kid template module should not be loaded in the render() function only, but in advance, in order to have a fair comparison with Genshi. Though this is not the actual reason why Kid compares slower, it still makes a measurable difference.
Good point, although I wonder whether this is the way Kid is commonly used in the real world?
comment:3 Changed 18 years ago by cmlenz
- Resolution set to fixed
- Status changed from assigned to closed
Patch to basic benchmark