nickva commented on issue #726: Provide a more accurate size check for max_document_size limit URL: https://github.com/apache/couchdb/pull/726#issuecomment-328142145 @davisp Good call on checking float sizes. I updated the benchmark repo with a float size comparison script. It includes, python, node.js and jsx encoders as well for more completeness. https://github.com/nickva/couch_ebench/blob/master/src/float_sizes.erl Here is output: ``` ./==> jiffy (get-deps) ==> jsx (get-deps) ==> jsone (get-deps) ==> couch_ebench (get-deps) ==> jiffy (compile) ==> jsx (compile) ==> jsone (compile) ==> couch_ebench (compile) Compiled src/float_sizes.erl Input | jiffy | erl | jsone | jsx | python | node | -------------------------------------------------------------------------------- 0.0 | 3 | 3 | 26 | 3 | 3 | 1 | 0.1 | 3 | 3 | 26 | 3 | 3 | 3 | 0.2 | 3 | 3 | 26 | 3 | 3 | 3 | 0.9 | 3 | 3 | 26 | 3 | 3 | 3 | 0.01 | 4 | 4 | 26 | 4 | 4 | 4 | 0.001 | 5 | 5 | 26 | 5 | 5 | 5 | 0.00001 | 7 | 7 | 26 | 6 | 5 | 7 | 0.002 | 5 | 5 | 26 | 5 | 5 | 5 | 0.0002 | 6 | 6 | 26 | 6 | 6 | 6 | 0.000002 | 8 | 8 | 26 | 6 | 5 | 8 | 0.11 | 4 | 4 | 26 | 4 | 4 | 4 | 0.111 | 5 | 5 | 26 | 5 | 5 | 5 | 0.1111 | 6 | 6 | 26 | 6 | 6 | 6 | 0.3333333 | 9 | 9 | 26 | 9 | 9 | 9 | 0.33333333 | 10 | 10 | 26 | 10 | 10 | 10 | 0.90000009 | 10 | 10 | 26 | 10 | 10 | 10 | 0.900000009 | 11 | 11 | 26 | 11 | 11 | 11 | 0.99999999 | 10 | 10 | 26 | 10 | 10 | 10 | 0.999999999 | 11 | 11 | 26 | 11 | 11 | 11 | 0.100000000000000017 | 19 | 3 | 26 | 19 | 19 | 19 | 0.10000000000000000018 | 3 | 3 | 26 | 3 | 3 | 3 | 1.0 | 3 | 3 | 26 | 3 | 3 | 1 | 1.1 | 3 | 3 | 26 | 3 | 3 | 3 | 20.02 | 5 | 5 | 26 | 5 | 5 | 5 | 300.003 | 7 | 7 | 26 | 7 | 7 | 7 | 4000.0004 | 9 | 9 | 26 | 9 | 9 | 9 | 50000.00005 | 11 | 11 | 26 | 11 | 11 | 11 | 600000.000006 | 13 | 13 | 26 | 13 | 13 | 13 | 10000000000.0 | 13 | 13 | 26 | 6 | 13 | 11 | 11111111111.01 | 14 | 22 | 26 | 14 | 14 | 14 | 99999999999.99999999 | 14 | 14 | 26 | 6 | 14 | 12 | 3.3333332538604736328125 | 18 | 12 | 26 | 18 | 18 | 18 | 3.3333333 | 9 | 9 | 26 | 9 | 9 | 9 | 2.000002 | 8 | 8 | 26 | 8 | 8 | 8 | 2.0000002 | 9 | 9 | 26 | 9 | 9 | 9 | 2.00000002 | 10 | 10 | 26 | 10 | 10 | 10 | 2.0000057 | 9 | 9 | 26 | 9 | 9 | 9 | 2.0000057220458984375 | 18 | 12 | 26 | 18 | 18 | 18 | 1.0e1 | 4 | 4 | 26 | 4 | 4 | 2 | 1.0e10 | 13 | 13 | 26 | 6 | 13 | 11 | 1.000001e10 | 13 | 13 | 26 | 11 | 13 | 11 | 1.0000001e10 | 13 | 13 | 26 | 12 | 13 | 11 | 1.000001e16 | 19 | 16 | 26 | 11 | 12 | 17 | 1.1e16 | 19 | 16 | 26 | 6 | 7 | 17 | 1.0e25 | 5 | 16 | 26 | 6 | 5 | 5 | 1.0e30 | 5 | 16 | 26 | 6 | 5 | 5 | 1.00000000001e29 | 17 | 16 | 26 | 16 | 17 | 17 | 1.00000000001e30 | 17 | 16 | 26 | 16 | 17 | 17 | 1.0e100 | 6 | 6 | 27 | 7 | 6 | 6 | 1.0e308 | 6 | 6 | 27 | 7 | 6 | 6 | 2.718281828459045235 | 17 | 12 | 26 | 17 | 17 | 17 | 3.141592653589793238 | 17 | 12 | 26 | 17 | 17 | 17 | 3.141592653589793238e100 | 22 | 6 | 27 | 21 | 22 | 22 | 1.1443742e-28 | 13 | 16 | 26 | 13 | 13 | 13 | 3.0316488e-13 | 13 | 3 | 26 | 13 | 13 | 13 | 2.7670118E19 | 22 | 16 | 26 | 12 | 13 | 20 | 1.0e-10 | 5 | 12 | 26 | 7 | 5 | 5 | 1.0e-30 | 5 | 16 | 26 | 7 | 5 | 5 | 1.000000001e-30 | 15 | 16 | 26 | 15 | 15 | 15 | 1.0e-100 | 6 | 6 | 27 | 8 | 6 | 6 | 1.0e-200 | 6 | 6 | 27 | 8 | 6 | 6 | 1.0e-308 | 6 | 6 | 27 | 8 | 6 | 6 | ``` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
With regards, Apache Git Services
