1
0
mirror of https://github.com/ultrajson/ultrajson.git synced 2024-11-24 05:12:02 +01:00
Commit Graph

59 Commits

Author SHA1 Message Date
Tim Dawborn
dcddcc4eba Corrected function dispatching for sort_keys. Added benchmarking section
for sort_keys.
2015-04-08 20:42:57 +02:00
Tim Dawborn
921716a3b7 Initial support for sort_keys parameter for JSON encoding. 2015-04-08 20:42:56 +02:00
Joakim Hamrén
d143d9d7bb Merge pull request #166 from leplatrem/option_disable_escape_slashes
Add option to disable forward slash escape
2015-04-08 13:51:30 +02:00
Mathieu Leplatre
d169b7ccbc Add option to disable forward slash escape
Ref issue #144
2015-03-31 23:41:51 +02:00
INADA Naoki
ab8f41954a Don't use deprecated PyUnicode_EncodeUTF8() 2014-12-26 11:31:33 +09:00
INADA Naoki
af1b05d74e Zero cost utf-8 encode for PyASCIIObject.
Before:
$ python3.4 -m timeit -n 10000 -s 'import ujson; x = ["a"*10]*100' 'ujson.dumps(x)'
10000 loops, best of 3: 15.8 usec per loop

After:
$ python -m timeit -n 10000 -s 'import ujson; x = ["a"*10]*100' 'ujson.dumps(x)'
10000 loops, best of 3: 7.14 usec per loop

Other unicode objects creates utf-8 cache in PyUnicode_AsUTF8AndSize().
It consume extra memory.
2014-12-26 01:54:45 +09:00
Joakim Hamrén
c9744834ab Merge pull request #142 from kevinbirch/support_unsigned_long_numerics
Support values between [0, 2^64 - 1]
2014-11-14 00:33:20 +01:00
kevin birch
cbd68782c8 add encoding support for unsigned long long 2014-11-11 18:25:27 -05:00
Joakim Hamren
7d28dc09ec Fixed segfault on invalid unicode char on python 3 2014-10-28 23:32:14 +01:00
Jonas Tarnstrom
0d76bd0849 Revert "Minor performance optimization"
This reverts commit 510a8fc6d7fd2af9fd39970ff3de4d9aac382706.
2014-04-16 08:42:48 +02:00
Jonas Tarnstrom
510a8fc6d7 Minor performance optimization 2014-04-14 15:52:22 +02:00
Jonas Tarnstrom
4057771d9c Added private argument support for encoder path 2014-04-14 14:43:15 +02:00
Jonas Tarnstrom
9f3449b826 Updated copyright clause 2014-04-14 13:45:50 +02:00
Jonas Tarnstrom
06173a7354 Improved generic iterator support, revmoed iterBegin from encoder API, added test for blist 2014-04-14 13:39:03 +02:00
Mark Vismonte
2dca0063b5 [ujson] Fixing seg faults in unit tests
- The following unit tests were causing segfaults:
```
test_doubleLongDecimalIssue
test_invalidDoublePrecision
test_doublePrecisionTest
test_encodeDecimal
test_doubleLongIssue
test_encodeDecodeLongDecimal
```
- I changed a constant that couldn't be `const` because it can be overwritten by
  a passed in parameter
2014-02-02 00:58:57 +00:00
Jonas Tärnström
e339f5b9d7 Merge pull request #107 from romuloceccon/silence_unused_PyIntToINTXX_warning
Silence warning about unused PyIntToINTXX
2013-10-04 07:46:27 -07:00
Romulo A. Ceccon
343d36719b Silence warning about unused PyIntToINTXX
Make the declaration of PyIntToINT32/PyIntToINT64
conditional; otherwise the compiler always warns
about one of them being unused.
2013-09-26 17:15:59 -03:00
Romulo A. Ceccon
28b3bb371f Make idoublePrecision a true constant
Some older compilers might complain about
idoublePrecision not being a constant when
referenced inside the array declaration.
2013-09-26 17:06:08 -03:00
Romulo A. Ceccon
1f4b786efb Fixed support for distributions without decimal.py
ujson crashed Python if decimal.py wasn't
available. This fix makes ujson ignore the problem
and instead assume no Decimal object will be
passed in to ujson.dumps().
2013-08-19 08:23:41 -03:00
Kieran O'Mahony
6242c253af whitespace fix 2013-06-18 14:21:43 +01:00
Jonas Tarnstrom
4073babe2c Merged (line-by-line prv pointer additions from ujson4c project. Bumped version 2013-06-10 12:44:04 +02:00
Mikhail Sychev
e098bd1ce9 Fixed style of .c and .h files to use 2 spaces instead of 4 spaces and tabs and added some braces for easier code reading. 2013-05-08 13:52:53 -07:00
jtarnstrom
3492d4c751 Reapplied code formatting for MSVC, sorry guys 2013-02-12 17:15:42 +01:00
jtarnstrom
fd6cc28ab9 Added support for python decimal. Forward ported encode_html_chars patch. Made it all into one big nice commit 2013-02-12 17:15:42 +01:00
unknown
42e7d1d9da Hopefully fixed integer and double decoding capabilities to match those of the old decoder 2013-01-18 16:17:47 +01:00
unknown
a2e9adb885 Updated license preamble 2013-01-16 16:22:08 +01:00
unknown
bdf13516d2 Implemented encoder support for Python Set object and derivatives. Bumped version 2012-12-17 17:49:38 +01:00
Jonas Tarnstrom
a6af1d09c6 Updated license to 3-clause BSD 2012-06-25 11:29:54 +02:00
Kieran O'Mahony
fd3e969987 fix ref leaks in datetime code 2012-06-12 16:25:40 +01:00
Kieran O'Mahony
6901f41a7c memory alignment fixes
Avoids segmentation faults on strict architectures e.g. SPARC
2012-06-12 12:05:00 +01:00
Kieran O'Mahony
06992a2072 Python 3 support 2012-06-12 12:04:59 +01:00
Kieran O'Mahony
fda0329ca9 msvc build fixes 2012-06-12 12:04:59 +01:00
Kieran O'Mahony
35ba3e9da0 better datetime & date handling 2012-06-12 12:04:59 +01:00
Kieran O'Mahony
79e980641d fix compiler warnings
& remove redundant enum
2012-06-12 12:04:59 +01:00
Kieran O'Mahony
d041aba16a tabs -> spaces, convert newlines 2012-06-12 12:04:59 +01:00
Jonas Trnstrm
5950848bf9 Changed default recursion limit. Added new benchmark 2012-01-27 15:25:36 +01:00
Mike Krieger
6b89292e5e Allow a kwarg to be passed in specifying the double precision 2012-01-03 16:33:34 -08:00
Jonas Tarnstrom
3c45be7241 Fixed toDict() not working issue, added test 2011-12-21 11:52:54 +01:00
Jonas Tarnstrom
b243a4a0d7 Fixed long forgotten memory leak in file object handling code for Python 2011-12-14 16:28:41 +01:00
Jonas Tarnstrom
824a42bf8c - Added support for detecting overflow scenario when a PyLong bigger than 64-bits signed is supposed to be converted to such. Now a proper Python exception is thrown
- Bumped version

- Encoder now uses JT_INVALID from client implementation to abort encoder
2011-09-19 17:30:35 +02:00
Jonas Tarnstrom
daf0fde4c9 - Fixed issue with parsing kwargs
- Fixed test for ensure_ascii
- Bumped version
- Fixed / decoding issue in lookup tables
2011-09-09 17:13:31 +02:00
Jonas Tarnstrom
e962ae68e2 - Added forceAscii option to encoder to control if output is forced to be ascii (<128) or not.
- Added ensure_ascii kwargs to encode/dumps (true is default). Use ensure_ascii=false to allow UTF_8 strings to be outputted, should be faster and more space efficient.

- Bumped version
2011-09-09 16:00:23 +02:00
Hong Minhee
6dc158775d Hard tab indent. 2011-08-15 23:10:27 -04:00
Hong Minhee
31e8d76b74 Added dump/load functions that take a file object. 2011-08-15 23:08:53 -04:00
Jonas Tärnström
7a9b93266b Merge pull request #16 from mbra/master
Fix segfault when encoding python unicode dict-keys
2011-06-16 00:55:26 -07:00
Nick Vatamaniuc
c6ad2dd060 Python 2.4 compatibility 2011-06-05 06:16:30 -04:00
Michael van Bracht
4aa6e24d93 convert unicode dict-keys to utf8 strings 2011-05-27 08:09:52 +02:00
Jonas Tärnström
0600783ac8 - Fixed include path issue 2011-03-25 11:05:20 +01:00
Jonas Tärnström
6c19d69796 - Added test for neg infinity
- Fixed 64-bit encoding issue on x64 Linux
- Made JSON_DECODE_NUMERIC_AS_DOUBLE disabled by default. Enable it to improve 32-bit performance but with the loss of long integer precision
2011-03-22 21:22:58 +01:00
Jonas Tärnström
101bb3e7f7 - Fixed some more gcc and msvc9 compiler warnings
- Code cleanups
- FIXME cleanups
2011-03-21 15:33:19 +01:00