forked from ohler55/oj
-
Notifications
You must be signed in to change notification settings - Fork 0
/
notes
61 lines (47 loc) · 1.8 KB
/
notes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
;; -*- mode: outline; outline-regexp: " *[-\+]"; indent-tabs-mode: nil; fill-column: 120 -*-
^c^d hide subtree
^c^s show subtree
Strict Dump Performance
JSON::Ext.dump 20000 times in 0.173 seconds or 115493.546 dump/sec.
Oj:strict.dump 20000 times in 0.050 seconds or 401475.753 dump/sec.
Summary:
System time (secs) rate (ops/sec)
--------- ----------- --------------
Oj:strict 0.050 401475.753
JSON::Ext 0.173 115493.546
Comparison Matrix
(performance factor, 2.0 means row is twice as fast as column)
Oj:strict JSON::Ext
--------- --------- ---------
Oj:strict 1.00 3.48
JSON::Ext 0.29 1.00
- big decimal
- just in custom mode, maybe in strict?
- encode_big_decimal_as_string
- add as fix for rails change
- rails
- Process::Status
- ActiveSupport::TimeWithZone
- ActiveModel::Errors
- ActiveSupport::Multibyte::Chars
- ActiveRecord::Relation
- debug
- instrument for parsing floats/bigdecimal
- branch
- option to allow invalid unicode through
- unit tests for 32 bit - test_float_parse
- look at RUBY_PLATFORM maybe?
- look at env var for OJ_DEBUG when doing ruby extconf.rb
- add printf for keys spots in parse and dump
- invalid character option
- don't check options
- replace with best attempt such as \ud83d => \xED\xA0\xBD
- that would be the normal replacement
- allow_invalid_unicode
- streaming parser for scp and saj
---------------------------
Tried a separate thread for the parser and the results were poor. The parsing is
10% to 15% of the total so splitting ruby calls and c does not help much and the
overhead of swapping data was too high. It was not possible to split ruby calls
into both threads due to not getting a lock on the ruby environment for object
creation.