Fix segfaults on musl libc when ultrajson runs in a thread. On musl libc
the default thread stack size is only 80k so allocating a 128k buffer on
stack will guarantee a crash. There seems not to be any evident
performance benefit using big buffer on stack either so we just reduce
the default.
fixes #254
with this ujson matches the builtin json behavior for NaN and Inf.
if a user wants to retain the old behavior they can pass allow_nan=False
to ensure strict json compatibility.
To fix issues with floating-point precision we've made use of Google's
double-conversion lib to handle conversions of doubles to and from strings.
In addition to fixing our precision problems this will improve double
encoding by 4-5x. Decoding is however slightly slower according to the
benchmarks - but accurate at least.
This change removes the double_precision encoding option and the
precise_float decoding option.
Previously a None dict item key would be outputted in JSON as "None".
To better align with the standard json module this was changed to output
"null". There's no proper representation of null object keys in JSON so
this is implementation specific but it seems more natural to follow
suit when it can be done without a significant performance hit.
Added and used branch prediction macros (LIKELY/UNLIKELY) as well.
- Fixed segfault when using sort_keys=True on dict with unorderable keys (GH247)
- Fixed refcount becoming negative when using sort_keys=True (GH243)
- Fixed compile error when defining JSON_NO_EXTRA_WHITESPACE
caused by a wrongly named variable. (GH245)
1. It reduces clutter in symbol table.
2. It fixes issues with C99 inline semantics for functions
marked as inline (#237, #180, #222), which manifests
when compiled with GCC>=5.
both Python 2 and Python 3, removing the need for 2to3 to be run. This
indirectly fixes #177.
* Corrected a duplicate-named method in the unit testing code. Corrected the
now-exposed broken logic that wasn't being tested. This was
highlighted in #186 but the author did not appear to realise that the
method name was being masked in the unit test class.
* Corrected the test case skipping logic to use unittest.skipIf instead
of just returning from the method upon an ImportError so that the skip
can actually be registered as a skipped test instead of a passed test.
* Updated the tests to additionally run on Python 3.5 on Travis. This
covers #195.
* Merged the two benchmarking files into one, and modularised the code.
Also added native RST output so the benchmarking results can be placed
directly into the README file.