mirror of https://github.com/svaarala/duktape.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
1.1 KiB
31 lines
1.1 KiB
--- !ditz.rubyforge.org,2008-03-06/issue
|
|
title: optimize json encode/decode performance
|
|
desc: |-
|
|
Performance of encoding/decoding plain ASCII data (which is often 99+% of
|
|
JSON encoded data) should be improved.
|
|
|
|
Decoding can take advantage of the fact that a NUL cannot occur inside a
|
|
valid JSON document. So, as long as the input is NUL terminated, and all
|
|
syntax checking is correct, an attempt to read beyond the input buffer will
|
|
cause a syntax error when the NUL is encountered. Explicit bounds checking
|
|
is thus not necessary at all.
|
|
|
|
Encoding should have a fast path which first ensures that there is enough
|
|
space to process N input characters safely (taking into account the maximum
|
|
possible expansion caused by e.g. escaping). Inside the safe loop there is
|
|
no need to check for output space for each output character.
|
|
type: :task
|
|
component: duk
|
|
release:
|
|
reporter: sva <sami.vaarala@iki.fi>
|
|
status: :unstarted
|
|
disposition:
|
|
creation_time: 2013-09-10 19:39:08.860112 Z
|
|
references: []
|
|
|
|
id: 42b394dbd86284c1b8e15f3f35733ac1efdc7f88
|
|
log_events:
|
|
- - 2013-09-10 19:39:09.081188 Z
|
|
- sva <sami.vaarala@iki.fi>
|
|
- created
|
|
- ""
|
|
|