#35440: Update parse_header_parameters to leverage the parsing logic from
(stdlib)
email Message.
--------------------------------------+------------------------------------
Reporter: Natalia Bidart | Owner: Pravin
Type: Cleanup/optimization | Status: assigned
Component: HTTP handling | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Comment (by Pravin):
my previous suggestion was failing for one test case.
So I wrote new simple patch as below modifying the existing one as below
in the diff
attachment:diff.txt
and i ran 9 to 10 times attachment:bench_mark.py
50,000 iterations for each. and following result i got on average. I used
linux i3 8gb 5 year old laptop may be that's why i'm getting fluctuations
in the results.
Complex test case (which triggers the fallback), results varied between
-73% and +42% across runs.
{{{
Test Case Original Avg Time Optimized Avg
Time Improvement (Avg)
Simple (No Params) ~0.047s ~0.012s
~73%
Standard (Charset) ~0.110s ~0.045s
~59%
Multi-Param ~0.190s ~0.065s
~65%
Complex (RFC 2231) ~0.650s ~0.530s
Variable*
}}}
Below are the sampled results when i ran attachment:bench_mark.py for 15
consecutive times:
{{{
Run | Simple | Standard | Multi-P | Complex |
----------------------------------------------
1 | 70.26% | 63.36% | 65.50% | -2.99% |
2 | 66.09% | 57.83% | 63.27% | -34.87% |
3 | 73.31% | 57.90% | 59.09% | -17.48% |
4 | 78.64% | 58.98% | 65.31% | 36.69% |
5 | 74.02% | 59.89% | 60.66% | 39.80% |
6 | 74.90% | 58.15% | 53.38% | 23.74% |
7 | 74.85% | 60.53% | 65.36% | 33.77% |
8 | 71.63% | 53.78% | 54.52% | 28.88% |
9 | 72.75% | 53.04% | 65.91% | 33.18% |
10 | 71.69% | 60.46% | 64.59% | -14.10% |
11 | 75.16% | 61.84% | 67.22% | 36.87% |
12 | 74.15% | 58.61% | 64.92% | -73.24% |
13 | 72.17% | 56.63% | 63.03% | 33.01% |
14 | 73.14% | 47.98% | 64.39% | 24.96% |
15 | 73.54% | 57.26% | 64.47% | 25.37% |
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35440#comment:24>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/0107019bb7d0a145-7d030a78-5f0a-4818-b451-933f7e1e4cc9-000000%40eu-central-1.amazonses.com.