summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Some more changes from ruby 2.7.0merge-recent-ruby-changesFlorian Frank2019-12-106-18/+103
|
* Use newest rubygemsFlorian Frank2019-04-292-2/+2
|
* Pass args all #to_json in json/add/*.Sho Hashimoto2019-04-294-8/+8
|
* Add LICENSE fileFlorian Frank2019-04-291-0/+56
|
* Merge branch 'master' of github.com:flori/jsonFlorian Frank2019-04-2918-4335/+186
|\
| * Merge pull request #376 from olleolleolle/patch-1SHIBATA Hiroshi2019-03-041-1/+1
| |\ | | | | | | README: Docs at rubydoc.info, not on rubyforge
| | * README: Docs at rubydoc.info, not on rubyforgeOlle Jonsson2019-03-031-1/+1
| |/ | | | | - [ci skip]
| * Merge branch 'master' of github.com:flori/jsonv2.2.0Florian Frank2019-02-211-1/+1
| |\
| | * Merge pull request #366 from sho-h/fix-ascii_only-documentFlorian Frank2019-02-211-1/+1
| | |\ | | | | | | | | fix JSON::Generator::State#ascii_only? document same as lib/json/pure/generator.rb.
| | | * fix JSON::Generator::State#ascii_only? document same as ↵Sho Hashimoto2019-01-081-1/+1
| | | | | | | | | | | | | | | | lib/json/pure/generator.rb.
| | * | Add some missing ruby 2.6 changesFlorian Frank2019-02-216-91/+98
| | | |
| | * | Merge pull request #369 from sho-h/fix-typoSHIBATA Hiroshi2019-01-091-1/+1
| | |\ \ | | | |/ | | |/| Fix a typo.
| | | * Fix a typo.Sho Hashimoto2019-01-091-1/+1
| | |/
| | * Merge pull request #362 from mrkn/update_for_bigdecimalSHIBATA Hiroshi2018-12-202-4/+38
| | |\ | | | | | | | | Fix for bigdecimal updates
| | | * Fix for bigdecimal updatesKenta Murata2018-12-022-4/+38
| | | | | | | | | | | | | | | | `BigDecimal.new` is no longer available from bigdecimal-1.4.0.
| * | | It's more trouble than it's worth.Florian Frank2019-02-215-4224/+1
| | | |
| * | | Use which to resolve to actual pathFlorian Frank2019-02-211-4/+9
| | | |
| * | | [fix] 2.5 compat on JRuby 9.2 Fixnum/Bignum -> Integerkares2019-02-211-10/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | slightly ugly but the only way to still compile under 1.7 once Ruby 1.9.3 gets dropped this should get ironed out ! resolves GH-336
| * | | Always use underscore for match stringFlorian Frank2019-02-212-4/+4
| | | |
| * | | Upgrade version to 1.6Florian Frank2019-02-211-1/+1
| | | |
| * | | Bump version to 2.2.0Florian Frank2019-02-215-5/+8
| | | |
| * | | Add some missing ruby 2.6 changesFlorian Frank2019-02-216-91/+98
| | | |
| * | | Fix a typo.Sho Hashimoto2019-02-211-1/+1
| | | |
| * | | Fix for bigdecimal updatesKenta Murata2019-02-212-4/+38
| |/ / | | | | | | | | | `BigDecimal.new` is no longer available from bigdecimal-1.4.0.
| * | Merge pull request #359 from flori/pick-ruby-coreSHIBATA Hiroshi2018-12-202-10/+15
| |\ \ | | | | | | | | Backport from Ruby core repository
| | * | ext/json/parser/parser.c: do not call rb_str_resize() on Time objectpick-ruby-coreeregon2018-10-252-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | * See https://github.com/flori/json/issues/342 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| | * | Fix missed update of parser source in r62429eregon2018-10-251-0/+1
| | | | | | | | | | | | | | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| * | | Merge pull request #363 from yui-knk/fix_typosSHIBATA Hiroshi2018-12-101-2/+2
| |\ \ \ | | |_|/ | |/| | Fix typos in README.md
| | * | Article is duplicatedyui-knk2018-12-101-1/+1
| | | |
| | * | "load the" is duplicatedyui-knk2018-12-101-1/+1
| |/ /
| * | Merge pull request #360 from flori/remove-control-charsSHIBATA Hiroshi2018-10-311-0/+0
| |\ \ | | | | | | | | Removed control characters from gemspec.
| | * | Removed control characters from gemspecSHIBATA Hiroshi2018-10-311-0/+0
| |/ /
| * | Fixup 0d1c2a0f0e62839ccc049cbd3b0810e276d1e1caSHIBATA Hiroshi2018-10-251-2/+3
| |/
| * Temporary ignored CI result of JRuby. see https://github.com/flori/json/pull/355SHIBATA Hiroshi2018-10-251-1/+1
| |
| * Merge pull request #352 from nicolasleger/patch-1SHIBATA Hiroshi2018-10-241-2/+3
| |\ | | | | | | [CI] Test against Ruby 2.5
| | * [CI] Test against Ruby 2.5Nicolas Leger2018-03-261-2/+3
| | |
| * | Merge pull request #340 from lostapathy/fix_travis_widgetSHIBATA Hiroshi2018-10-231-2/+3
| |\ \ | | |/ | |/| fix link in travis widget
| | * fix link in travis widgetJoe Francis2017-10-091-2/+3
| |/
* | Does not check whether illegal utf-8 if string has ascii only.Watson2019-04-291-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ## Before ``` $ ruby bench_json_generate.rb Warming up -------------------------------------- json 25.000 i/100ms Calculating ------------------------------------- json 250.478 (± 4.8%) i/s - 1.250k in 5.002238s ``` ## After ``` $ ruby bench_json_generate.rb Warming up -------------------------------------- json 32.000 i/100ms Calculating ------------------------------------- json 360.652 (± 3.6%) i/s - 1.824k in 5.064511s ``` ## Test code ``` require 'json' require 'benchmark/ips' obj = [] 1000.times do |i| obj << { :string => "x" * 100, :utf8 => "あ" * 100 } end Benchmark.ips do |x| x.report "json" do |iter| count = 0 while count < iter JSON.generate(obj) count += 1 end end end ```
* | Convert string encoding to UTF-8 only when neededWatson2019-04-291-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ## Before ``` $ ruby bench_json_generate.rb Warming up -------------------------------------- json 129.000 i/100ms Calculating ------------------------------------- json 1.300k (± 2.3%) i/s - 6.579k in 5.064656s ``` ## After ``` $ ruby bench_json_generate.rb Warming up -------------------------------------- json 189.000 i/100ms Calculating ------------------------------------- json 1.964k (± 3.3%) i/s - 9.828k in 5.011237s ``` ## Code ``` require 'json' require 'benchmark/ips' obj = [] 1000.times do |i| obj << { "id" => i, :age => 42, } end Benchmark.ips do |x| x.report "json" do |iter| count = 0 while count < iter JSON.generate(obj) count += 1 end end end ```
* | Convert String encoding using `rb_str_encode()`Watson2019-04-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `rb_funcall` might be slightly heavy to call the Ruby method. This patch will convert String encoding using `rb_str_encode()` instead of `rb_funcall()`. ## Before ``` $ ruby bench_json_generate.rb Warming up -------------------------------------- json 78.000 i/100ms Calculating ------------------------------------- json 789.781 (± 2.7%) i/s - 3.978k in 5.041043s ``` ## After ``` $ ruby bench_json_generate.rb Warming up -------------------------------------- json 129.000 i/100ms Calculating ------------------------------------- json 1.300k (± 2.3%) i/s - 6.579k in 5.064656s ``` ## Code ``` require 'json' require 'benchmark/ips' obj = [] 1000.times do |i| obj << { "id" => i, :age => 42, } end Benchmark.ips do |x| x.report "json" do |iter| count = 0 while count < iter JSON.generate(obj) count += 1 end end end ```
* | Add shortcut converting to StringWatson2019-04-291-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In where to convert Hash key to String for json, this patch will add shortcut for String/Symbol in Hash key. ``` $ ruby bench_json_generate.rb Warming up -------------------------------------- json 65.000 i/100ms Calculating ------------------------------------- json 659.576 (± 1.5%) i/s - 3.315k in 5.027127s ``` ``` $ ruby bench_json_generate.rb Warming up -------------------------------------- json 78.000 i/100ms Calculating ------------------------------------- json 789.781 (± 2.7%) i/s - 3.978k in 5.041043s ``` ``` require 'json' require 'benchmark/ips' obj = [] 1000.times do |i| obj << { "id" => i, :age => 42, } end Benchmark.ips do |x| x.report "json" do |iter| count = 0 while count < iter JSON.generate(obj) count += 1 end end end ```
* | Convert Hash object using rb_hash_foreach()Watson2019-04-291-22/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To convert Hash convert, this part was using following pseudo code ``` obj.keys.each do |key| value = obj[key] ... end ``` and `rb_funcall()` was called for `obj.keys`. It might be slightly heavy to call the Ruby method. This patch will iterate to convert Hash object about key/value using `rb_hash_foreach()` Ruby API instead of `rb_funcall()`. ``` $ ruby bench_json_generate.rb Warming up -------------------------------------- json 55.000 i/100ms Calculating ------------------------------------- json 558.501 (± 1.1%) i/s - 2.805k in 5.022986s ``` ``` $ ruby bench_json_generate.rb Warming up -------------------------------------- json 65.000 i/100ms Calculating ------------------------------------- json 659.576 (± 1.5%) i/s - 3.315k in 5.027127s ``` ``` require 'json' require 'benchmark/ips' obj = [] 1000.times do |i| obj << { "id" => i, :age => 42, } end Benchmark.ips do |x| x.report "json" do |iter| count = 0 while count < iter JSON.generate(obj) count += 1 end end end ```
* | Only attempt to resize strings not other objectsFlorian Frank2019-04-292-2/+2
| |
* | Test on newer rubiesFlorian Frank2019-03-141-2/+4
| |
* | fix test as reported in #343Florian Frank2017-12-211-1/+1
|/
* Allow failing 1.9.3 on travisFlorian Frank2017-10-041-0/+1
|
* JSON marshalling support for Set and SortedSetJosh Kline2017-10-042-0/+39
|
* Merge pull request #332 from perlun/patch-3Florian Frank2017-10-041-0/+12
|\ | | | | README: Added note about json/add/exception
| * README: Added note about json/add/exceptionPer Lundberg2017-06-011-0/+12
| |