--- JSON-XS/XS.xs 2011/03/08 10:18:50 1.109 +++ JSON-XS/XS.xs 2011/08/11 17:06:53 1.112 @@ -262,6 +262,7 @@ // this relies greatly on the quality of the pow () // implementation of the platform, but a good // implementation is hard to beat. + // (IEEE 754 conformant ones are required to be exact) if (postdp) *expo -= eaccum; *accum += uaccum * Perl_pow (10., *expo); *expo += eaccum; @@ -1993,7 +1994,16 @@ (unsigned long)self->incr_pos, (unsigned long)self->max_size); if (!INCR_DONE (self)) - break; + { + // as an optimisation, do not accumulate white space in the incr buffer + if (self->incr_mode == INCR_M_WS && self->incr_pos) + { + self->incr_pos = 0; + SvCUR_set (self->incr_text, 0); + } + + break; + } } XPUSHs (decode_json (self->incr_text, self, &offset));