Opened 13 years ago
Closed 13 years ago
#16499 closed Cleanup/optimization (wontfix)
Improve load template performance
Reported by: | blacktear23 | Owned by: | nobody |
---|---|---|---|
Component: | Template system | Version: | 1.3 |
Severity: | Normal | Keywords: | Performance |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
After add a template cache, the performance of render a template is more faster.
I use apache benchmark do a test, as a result it will improve performance more than 2 times:
disable template cache:
Concurrency Level: 1
Time taken for tests: 29.380 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 6496000 bytes
HTML transferred: 6349000 bytes
Requests per second: 34.04 #/sec (mean)
Time per request: 29.380 [ms] (mean)
Time per request: 29.380 [ms] (mean, across all concurrent requests)
Transfer rate: 215.92 [Kbytes/sec] received
enable template cache:
Concurrency Level: 1
Time taken for tests: 11.639 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 6496000 bytes
HTML transferred: 6349000 bytes
Requests per second: 85.92 #/sec (mean)
Time per request: 11.639 [ms] (mean)
Time per request: 11.639 [ms] (mean, across all concurrent requests)
Transfer rate: 545.04 [Kbytes/sec] received
Attachments (1)
Change History (2)
by , 13 years ago
Attachment: | loader.py.diff added |
---|
comment:1 by , 13 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
I think you might want to take a look at the template caching feature added in Django 1.2. The approach you've applied here won't share anything between processes, and will result in a massive memory blowout as common templates are cached independently in each process.
Add template cache