Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
| * | regenerate parser | Aaron Patterson | 2016-06-21 | 1 | -0/+2 | |
| | | ||||||
| * | resize strings after parsing | Aaron Patterson | 2016-06-21 | 1 | -0/+2 | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The parser uses `rb_str_buf_new` to allocate new strings. `rb_str_buf_new` [has a minimum size of 128 and is not an embedded string](https://github.com/ruby/ruby/blob/9949407fd90c1c5bfe332141c75db995a9b867aa/string.c#L1119-L1135). This causes applications that parse JS to allocate extra memory when parsing short strings. For a real-world example, we can use the mime-types gem. The mime-types gem stores all mime types inside a JSON file and parses them when you require the gem. Here is a sample program: ```ruby require 'objspace' require 'mime-types' GC.start GC.start p ObjectSpace.memsize_of_all String ``` The example program loads the mime-types gem and outputs the total space used by all strings. Here are the results of the program before and after this patch: ** Before ** ``` [aaron@TC json (memuse)]$ ruby test.rb 5497494 [aaron@TC json (memuse)]$ ``` ** After ** ``` [aaron@TC json (memuse)]$ ruby -I lib:ext test.rb 3335862 [aaron@TC json (memuse)]$ ``` This change results in a ~40% reduction of memory use for strings in the mime-types gem. Thanks @matthewd for finding the problem, and @nobu for the patch! | |||||
* | | Merge branch 'master' of github.com:flori/json | Florian Frank | 2016-06-21 | 2 | -0/+4 | |
|\ \ | |/ |/| | ||||||
| * | Merge pull request #260 from tenderlove/memuse | Florian Frank | 2016-06-11 | 2 | -0/+4 | |
| |\ | | | | | | | resize strings after parsing | |||||
| | * | regenerate parser | Aaron Patterson | 2016-06-11 | 1 | -0/+2 | |
| | | | ||||||
| | * | resize strings after parsing | Aaron Patterson | 2016-06-11 | 1 | -0/+2 | |
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The parser uses `rb_str_buf_new` to allocate new strings. `rb_str_buf_new` [has a minimum size of 128 and is not an embedded string](https://github.com/ruby/ruby/blob/9949407fd90c1c5bfe332141c75db995a9b867aa/string.c#L1119-L1135). This causes applications that parse JS to allocate extra memory when parsing short strings. For a real-world example, we can use the mime-types gem. The mime-types gem stores all mime types inside a JSON file and parses them when you require the gem. Here is a sample program: ```ruby require 'objspace' require 'mime-types' GC.start GC.start p ObjectSpace.memsize_of_all String ``` The example program loads the mime-types gem and outputs the total space used by all strings. Here are the results of the program before and after this patch: ** Before ** ``` [aaron@TC json (memuse)]$ ruby test.rb 5497494 [aaron@TC json (memuse)]$ ``` ** After ** ``` [aaron@TC json (memuse)]$ ruby -I lib:ext test.rb 3335862 [aaron@TC json (memuse)]$ ``` This change results in a ~40% reduction of memory use for strings in the mime-types gem. Thanks @matthewd for finding the problem, and @nobu for the patch! | |||||
* | | Merge more changes from ruby core | Florian Frank | 2016-06-21 | 5 | -138/+171 | |
| | | ||||||
* | | Easy diffing | Florian Frank | 2016-06-21 | 1 | -0/+11 | |
| | | ||||||
* | | Adapt to ruby integer unification | Florian Frank | 2016-06-21 | 2 | -3/+43 | |
|/ | ||||||
* | Merge pull request #283 from stomar/remove-comments | Florian Frank | 2016-06-07 | 9 | -9/+0 | |
|\ | | | | | Remove comments from core classes in json/add | |||||
| * | Remove comments from core classes in json/add | Marcus Stollsteimer | 2016-04-25 | 9 | -9/+0 | |
| | | ||||||
* | | Update rubies to test on | Florian Frank | 2016-06-07 | 1 | -1/+0 | |
| | | ||||||
* | | Update rubies to test on | Florian Frank | 2016-06-07 | 1 | -3/+1 | |
| | | ||||||
* | | Allow usage of simplecov with START_SIMPLECOV=1 | Florian Frank | 2016-06-07 | 2 | -0/+6 | |
| | | ||||||
* | | Use ~> 2.0 test-unit that runs on 1.8 rubies as well | Florian Frank | 2016-06-07 | 4 | -8/+8 | |
| | | ||||||
* | | Move dependencies into gemspec files | Florian Frank | 2016-06-07 | 4 | -9/+9 | |
| | | ||||||
* | | Also build against 2.2.3 | Rebecca Skinner | 2016-06-07 | 1 | -73/+131 | |
|\ \ | |/ | ||||||
| * | Merge pull request #278 from zeroed/master | Florian Frank | 2016-04-06 | 1 | -75/+133 | |
| |\ | | | | | | | Update README.md with formatting | |||||
| | * | Update README.md with formatting | Edoardo Rossi | 2016-04-06 | 1 | -75/+133 | |
| |/ | ||||||
* | | Move simplecov to test_helper.rb | Florian Frank | 2016-06-03 | 2 | -14/+2 | |
| | | ||||||
* | | Treat ASCII_8BIT as UTF-8 by default | Florian Frank | 2016-06-03 | 7 | -97/+95 | |
| | | ||||||
* | | Force ASCII 8bit to be UTF-8 and hope for the best | Florian Frank | 2016-06-03 | 2 | -85/+93 | |
| | | ||||||
* | | Only support newer Rubies e. g. Encoding | Florian Frank | 2016-06-03 | 4 | -114/+48 | |
| | | ||||||
* | | Test common interface | Florian Frank | 2016-06-03 | 2 | -15/+27 | |
| | | ||||||
* | | Use better name for this feature | Florian Frank | 2016-06-02 | 4 | -8/+8 | |
| | | ||||||
* | | Remove quirks mode | Florian Frank | 2016-06-02 | 19 | -619/+143 | |
| | | ||||||
* | | Update documentation for RFC 7159 support | Florian Frank | 2016-06-02 | 1 | -11/+0 | |
| | | ||||||
* | | Change rfc reference | Florian Frank | 2016-06-02 | 2 | -24/+6 | |
| | | ||||||
* | | Support newer rubies | Florian Frank | 2016-06-02 | 1 | -9/+1 | |
| | | ||||||
* | | current RFC added | Florian Frank | 2016-06-02 | 1 | -0/+899 | |
| | | ||||||
* | | Allow usage of simplecov with START_SIMPLECOV=1 | Florian Frank | 2016-06-02 | 2 | -0/+6 | |
| | | ||||||
* | | Declare encoding | Florian Frank | 2016-06-02 | 2 | -0/+3 | |
|/ | ||||||
* | Merge branch 'v1.8' | Florian Frank | 2016-02-25 | 2 | -8/+0 | |
|\ | ||||||
| * | Use ~> 2.0 test-unit that runs on 1.8 rubies as well | Florian Frank | 2016-02-25 | 4 | -8/+8 | |
| | | ||||||
| * | Only test main 2.2 branch | Florian Frank | 2016-02-25 | 1 | -3/+0 | |
| | | ||||||
| * | Move dependencies into gemspec files | Florian Frank | 2016-02-25 | 5 | -5/+23 | |
| | | ||||||
* | | Merge branch 'master' of github.com:flori/json | Florian Frank | 2016-02-25 | 0 | -0/+0 | |
|\ \ | ||||||
| * \ | Merge pull request #257 from sevenseacat/patch-1 | Florian Frank | 2015-08-21 | 1 | -0/+1 | |
| |\ \ | | | | | | | | | Also build against 2.2.3 | |||||
| | * | | Also build against 2.2.3 | Rebecca Skinner | 2015-08-21 | 1 | -0/+1 | |
| |/ / | ||||||
* | | | Use ~> 2.0 test-unit that runs on 1.8 rubies as well | Florian Frank | 2016-02-25 | 4 | -0/+21 | |
| | | | ||||||
* | | | Merge branch 'v1.8' | Florian Frank | 2016-02-25 | 25 | -552/+121 | |
|\ \ \ | | |/ | |/| | ||||||
| * | | Check for existence of #to_json method before call | Florian Frank | 2016-02-25 | 2 | -3/+11 | |
| | | | ||||||
| * | | Avoid system stack error | Florian Frank | 2016-02-25 | 1 | -1/+1 | |
| | | | ||||||
| * | | Remove permutation dependency | Florian Frank | 2016-02-25 | 4 | -41/+2 | |
| | | | ||||||
| * | | Be goneā¦ | Florian Frank | 2016-02-25 | 1 | -13/+0 | |
| | | | ||||||
| * | | Attempt to switch jruby into 2.0 mode | Florian Frank | 2016-02-25 | 1 | -4/+3 | |
| | | | ||||||
| * | | Add 2.3.0 for travis teting | Florian Frank | 2016-02-25 | 1 | -0/+1 | |
| | | | ||||||
| * | | Add missing tests | Florian Frank | 2016-02-25 | 1 | -0/+24 | |
| | | | ||||||
| * | | Call OBJECT_HANDLER for objects without #to_json | Florian Frank | 2016-02-25 | 1 | -5/+8 | |
| | | | | | | | | | as a last-ditch effort. | |||||
| * | | Correct CHANGES | Florian Frank | 2015-11-06 | 1 | -1/+2 | |
| | | |