Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Release: JSON::SIMD

by Tux (Canon)
on Apr 19, 2023 at 08:12 UTC ( [id://11151757]=note: print w/replies, xml ) Need Help??


in reply to Release: JSON::SIMD

  • YEAH!
  • Please get rid of junk like use common::sense; No need for it, and it'll be a reason for many to refuse this module. There is no need to be 100% compatible with JSON::XS :)
    Replacing use common::sense; with use strict; use warnings; and removing it from Makefile.PL will still build this new module.
  • There are still some test issues. See below

First problems with-Duselongdouble.

Test Summary Report ------------------- t/03_types.t (Wstat: 0 Tests: 91 Failed: 1) Failed test: 20 t/09_pc_extra_number.t (Wstat: 512 (exited 2) Tests: 6 Failed: 2) Failed tests: 2, 6 Non-zero exit status: 2 t/108_pc_base.t (Wstat: 256 (exited 1) Tests: 20 Failed: 1) Failed test: 13 Non-zero exit status: 1 t/11_pc_expo.t (Wstat: 1536 (exited 6) Tests: 8 Failed: 6) Failed tests: 1-2, 5-8 Non-zero exit status: 6 Files=41, Tests=51262, 3 wallclock secs ( 1.83 usr 0.02 sys + 3.00 +cusr 0.21 csys = 5.06 CPU) Result: FAIL Failed 4/41 test programs. 10/51262 subtests failed. # Failed test 'normal 0.1' # at t/09_pc_extra_number.t line 19. # got: '0.100000000000000006' # expected: '0.1' # Failed test 'normal 0.1' # at t/09_pc_extra_number.t line 34. # got: '0.100000000000000006' # expected: '0.1' # Failed test at t/108_pc_base.t line 67. # got: '[{"foo":[1,2,3]},-0.119999999999999996,{"a":"b"}]' # expected: '[{"foo":[1,2,3]},-0.12,{"a":"b"}]' # Failed test 'digit -12.34' # at t/11_pc_expo.t line 14. # got: '-12.3399999999999999' # expected: '-12.34' # Failed test 'digit -12.34' # at t/11_pc_expo.t line 16. # got: '[-12.3399999999999999]' # expected: '[-12.34]' # Failed test 'digit 1.23E-4' # at t/11_pc_expo.t line 26. # got: '0.000123000000000000008' # expected: '0.000123' # Failed test 'digit 1.23E-4' # at t/11_pc_expo.t line 28. # got: '[0.000123000000000000008]' # expected: '[0.000123]' # Failed test 'digit 1.01e+30' # at t/11_pc_expo.t line 33. # got: '1.01000000000000002e+30' # expected: '1.01e+30' # Failed test 'digit 1.01e+30' # at t/11_pc_expo.t line 35. # '[1.01000000000000002e+30]' # doesn't match '(?^:\[1.01[Ee]\+0?30\])'

update: problems with -Dusequadmath:

Test Summary Report ------------------- t/03_types.t (Wstat: 0 Tests: 91 Failed: 5) Failed tests: 20, 63, 65, 67, 69 t/08_pc_base.t (Wstat: 256 (exited 1) Tests: 20 Failed: 1) Failed test: 13 Non-zero exit status: 1 t/09_pc_extra_number.t (Wstat: 512 (exited 2) Tests: 6 Failed: 2) Failed tests: 2, 6 Non-zero exit status: 2 t/108_pc_base.t (Wstat: 256 (exited 1) Tests: 20 Failed: 1) Failed test: 13 Non-zero exit status: 1 t/111_pc_expo.t (Wstat: 1024 (exited 4) Tests: 8 Failed: 4) Failed tests: 2, 4, 6, 8 Non-zero exit status: 4 t/118_json_checker.t (Wstat: 256 (exited 1) Tests: 38 Failed: 1) Failed test: 34 Non-zero exit status: 1 t/11_pc_expo.t (Wstat: 1792 (exited 7) Tests: 8 Failed: 7) Failed tests: 1-2, 4-8 Non-zero exit status: 7 t/18_json_checker.t (Wstat: 256 (exited 1) Tests: 38 Failed: 1) Failed test: 34 Non-zero exit status: 1 Files=41, Tests=51262, 4 wallclock secs ( 2.03 usr 0.05 sys + 3.30 +cusr 0.42 csys = 5.80 CPU) Result: FAIL # Failed test at t/08_pc_base.t line 67. # got: '[{"foo":[1,2,3]},-5.16470253714989521769614242803951e +-284,{"a":"b"}]' # expected: '[{"foo":[1,2,3]},-0.12,{"a":"b"}]' # Failed test 'normal 0.1' # at t/09_pc_extra_number.t line 19. # got: '0.100000000000000005551115123125783' # expected: '0.1' # Failed test 'normal 0.1' # at t/09_pc_extra_number.t line 34. # got: '0.100000000000000005551115123125783' # expected: '0.1' # Failed test at t/108_pc_base.t line 67. # got: '[{"foo":[1,2,3]},-0,{"a":"b"}]' # expected: '[{"foo":[1,2,3]},-0.12,{"a":"b"}]' # Failed test 'digit -12.34' # at t/111_pc_expo.t line 16. # got: '[-4.16149525995245660415177131455366e+160]' # expected: '[-12.34]' # Failed test 'digit -1.234e5' # at t/111_pc_expo.t line 22. # got: '[0]' # expected: '[-123400]' # Failed test 'digit 1.23E-4' # at t/111_pc_expo.t line 28. # got: '[1.39229364695343630594391311287435e+131]' # expected: '[0.000123]' # Failed test 'digit 1.01e+30' # at t/111_pc_expo.t line 35. # '[7.39646566216833889484405517578125e-10]' # doesn't match '(?^:\[1.01[Ee]\+0?30\])' # Failed test at t/118_json_checker.t line 27. # got: '["JSON Test Pattern pass1",{"object with 1 member":[" +array with 1 element"]},{},[],-42,true,false,null,{"":-2.681561585988 +51941991480499964117e+154," s p a c e d ":[1,2,3,4,5,6,7],"# -- --> * +/":" ","/\\\"&#51966;&#47806;&#43928;&#64734;&#48346;&#61258;\b\f\n\r +\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?":"A key can be any string","0123456 +789":"digit","ALPHA":"ABCDEFGHIJKLMNOPQRSTUVWYZ","E":4.94065645841246 +544176568792868221e-324,"address":"50 St. James Street","alpha":"abcd +efghijklmnopqrstuvwyz","array":[],"backslash":"\\","comment":"// /* < +!-- --","compact":[1,2,3,4,5,6,7],"controls":"\b\f\n\r\t","digit":"01 +23456789","e":-1.28822975391942837791220787093014e-231,"false":false, +"hex":"&#291;&#17767;&#35243;&#52719;&#43981;&#61258;","integer":1234 +567890,"jsontext":"{\"object with 1 member\":[\"array with 1 element\ +"]}","null":null,"object":{},"one":1,"quote":"\"","quotes":"&#34; \" +%22 0x22 034 &#x22;","real":1.97626258336498617670627517147289e-323," +slash":"/ & /","space":" ","special":"`1~!@#$%^&*()_+-={':[,]}|;.</>? +","true":true,"url":"http://www.JSON.org/","zero":0},0,2.681561585988 +51465650454145595185e+154,-2,1066,0,0,-1.4916681462400403550076004297 +2117e-154,0,0,0,"rosebud"]' # expected: '["JSON Test Pattern pass1",{"object with 1 member":[" +array with 1 element"]},{},[],-42,true,false,null,{"":3.9448197099195 +3508016535956825005e-17," s p a c e d ":[1,2,3,4,5,6,7],"# -- --> */" +:" ","/\\\"&#51966;&#47806;&#43928;&#64734;&#48346;&#61258;\b\f\n\r\t +`1~!@#$%^&*()_+-=[]{}|;:',./<>?":"A key can be any string","012345678 +9":"digit","ALPHA":"ABCDEFGHIJKLMNOPQRSTUVWYZ","E":7.8200212909019225 +3880430107251014e+81,"address":"50 St. James Street","alpha":"abcdefg +hijklmnopqrstuvwyz","array":[],"backslash":"\\","comment":"// /* <!-- + --","compact":[1,2,3,4,5,6,7],"controls":"\b\f\n\r\t","digit":"01234 +56789","e":-2.08901806452088517172252101925494e+70,"false":false,"hex +":"&#291;&#17767;&#35243;&#52719;&#43981;&#61258;","integer":12345678 +90,"jsontext":"{\"object with 1 member\":[\"array with 1 element\"]}" +,"null":null,"object":{},"one":1,"quote":"\"","quotes":"&#34; \" %22 +0x22 034 &#x22;","real":-1.55021771966851640713822173276562e+162,"sla +sh":"/ & /","space":" ","special":"`1~!@#$%^&*()_+-={':[,]}|;.</>?"," +true":true,"url":"http://www.JSON.org/","zero":0},0,1.903598566255293 +16093668653799472e+185,-4310085580881.919921875,1066,0,0,-2.353437368 +26453540187321886879997e-185,0,0,0,"rosebud"]' # Failed test 'digit -12.34' # at t/11_pc_expo.t line 14. # got: '-12.33999999999999985789145284798' # expected: '-12.34' # Failed test 'digit -12.34' # at t/11_pc_expo.t line 16. # got: '[-2.68156158598851941991480499964117e+154]' # expected: '[-12.34]' # Failed test 'digit -1.234e5' # at t/11_pc_expo.t line 22. # got: '[0]' # expected: '[-123400]' # Failed test 'digit 1.23E-4' # at t/11_pc_expo.t line 26. # got: '0.00012300000000000000819830314746639' # expected: '0.000123' # Failed test 'digit 1.23E-4' # at t/11_pc_expo.t line 28. # got: '[2.68156158598851941991480499964117e+154]' # expected: '[0.000123]' # Failed test 'digit 1.01e+30' # at t/11_pc_expo.t line 33. # got: '1010000000000000017268721319936' # expected: '1010000000000000000000000000000' # Failed test 'digit 1.01e+30' # at t/11_pc_expo.t line 35. # '[2]' # doesn't match '(?^:\[1.01[Ee]\+0?30\])' # Failed test at t/18_json_checker.t line 27. # got: '["JSON Test Pattern pass1",{"object with 1 member":[" +array with 1 element"]},{},[],-42,true,false,null,{"":2," s p a c e d + ":[1,2,3,4,5,6,7],"# -- --> */":" ","/\\\"&#51966;&#47806;&#43928;&# +64734;&#48346;&#61258;\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?":"A k +ey can be any string","0123456789":"digit","ALPHA":"ABCDEFGHIJKLMNOPQ +RSTUVWYZ","E":0,"address":"50 St. James Street","alpha":"abcdefghijkl +mnopqrstuvwyz","array":[],"backslash":"\\","comment":"// /* <!-- --", +"compact":[1,2,3,4,5,6,7],"controls":"\b\f\n\r\t","digit":"0123456789 +","e":0,"false":false,"hex":"&#291;&#17767;&#35243;&#52719;&#43981;&# +61258;","integer":1234567890,"jsontext":"{\"object with 1 member\":[\ +"array with 1 element\"]}","null":null,"object":{},"one":1,"quote":"\ +"","quotes":"&#34; \" %22 0x22 034 &#x22;","real":0,"slash":"/ & /"," +space":" ","special":"`1~!@#$%^&*()_+-={':[,]}|;.</>?","true":true,"u +rl":"http://www.JSON.org/","zero":0},0,0,-2,1066,0,0,0,0,0,0,"rosebud +"]' # expected: '["JSON Test Pattern pass1",{"object with 1 member":[" +array with 1 element"]},{},[],-42,true,false,null,{"":2," s p a c e d + ":[1,2,3,4,5,6,7],"# -- --> */":" ","/\\\"&#51966;&#47806;&#43928;&# +64734;&#48346;&#61258;\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?":"A k +ey can be any string","0123456789":"digit","ALPHA":"ABCDEFGHIJKLMNOPQ +RSTUVWYZ","E":2.31584178474632390847141970017376e+77,"address":"50 St +. James Street","alpha":"abcdefghijklmnopqrstuvwyz","array":[],"backs +lash":"\\","comment":"// /* <!-- --","compact":[1,2,3,4,5,6,7],"contr +ols":"\b\f\n\r\t","digit":"0123456789","e":-2.31584178474632390847141 +970017376e+77,"false":false,"hex":"&#291;&#17767;&#35243;&#52719;&#43 +981;&#61258;","integer":1234567890,"jsontext":"{\"object with 1 membe +r\":[\"array with 1 element\"]}","null":null,"object":{},"one":1,"quo +te":"\"","quotes":"&#34; \" %22 0x22 034 &#x22;","real":-2.6815615859 +8851941991480499964117e+154,"slash":"/ & /","space":" ","special":"`1 +~!@#$%^&*()_+-={':[,]}|;.</>?","true":true,"url":"http://www.JSON.org +/","zero":0},0,2.68156158598851941991480499964117e+154,-2,1066,0,0,-1 +.49166814624004134865819306309259e-154,0,0,0,"rosebud"]'

Looking forward to using it!


Enjoy, Have FUN! H.Merijn

Replies are listed 'Best First'.
Re^2: Release: JSON::SIMD
by kikuchiyo (Hermit) on Apr 19, 2023 at 18:45 UTC

    Replacing use common::sense; with use strict; use warnings;

    I've thought about that. Personally, I don't use common::sense, because I happen to disagree with its warnings policy. However, during the development of this module I've tried to get away with as few changes to JSON::XS as possible, so I haven't touched this part yet. But perhaps you're right, it's not really needed, and dropping the non-core dependency would be an advantage. In fact, given that the actual Perl code in the module consists of exactly 10 assignments and a few uses, perhaps even the strict and warnings could be omitted.

    There are still some test issues.

    Yes, I saw those among the test reports. The problem is that simdjson returns floating point numbers as doubles, which is fine if Perl's NV happens to be a double, but not when -Duselongdouble or -Dusequadmath is in effect. It appears to me, based on the test results, that the -Duselongdouble case is mostly fine, because the failing tests merely betray a slight loss of precision. The intermittent garbage in the -Dusequadmath case is more worrying. I do recall a(n unanswered) bug report to JSON::XS with the exact same symptoms, so there might be deeper problems with this mode.

    In any case more care is warranted with number parsing, I'll try to do something about these failures.

    Thanks for the reports!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11151757]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-19 04:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found