[wsgi] Message body size validation is slow
Bug #1239768 reported by
Kurt Griffiths
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
zaqar |
Won't Fix
|
High
|
Unassigned |
Bug Description
Even trivial documents, such as {}, still takes 10 us or so.
I don't think we've seen this in our benchmarks because it has been short-circuited when message_
Changed in marconi: | |
milestone: | none → icehouse-1 |
Changed in marconi: | |
milestone: | icehouse-1 → none |
To post a comment you must log in.
Proposed change:
Redefine "document size" in terms of values/objects inside a document, neither JSON bytes nor JSON chars.
For example, each empty object/array/null has size 8, true/false have size 1, any number has size 8, string size == len(s). Walk trough the whole document and sum them up.
I guess 64K for each message, 256K in total should be enough.
This can also solve the msgpack problem, which has no concept of "chars". Same Python dictionary, no matter
how it's being represented, msgpack or JSON, has same size.