diff --git a/CHANGELOG.md b/CHANGELOG.md index 33393fe..3e6b913 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). 1. The [`ifelse` vectorized function in RemesPath](/docs/RemesPath.md#vectorized-functions) now uses conditional execution. +### Fixed + +1. Fixed issue where [vectorized functions in RemesPath](/docs/RemesPath.md#vectorized-functions) were not vectorized across objects if the first argument was a function of input and at least one of the non-first arguments was also a function of input. + ## [6.1.1] - 2023-12-28 ### Fixed diff --git a/JsonToolsNppPlugin/JSONTools/RemesPath.cs b/JsonToolsNppPlugin/JSONTools/RemesPath.cs index f5547db..943e7fd 100644 --- a/JsonToolsNppPlugin/JSONTools/RemesPath.cs +++ b/JsonToolsNppPlugin/JSONTools/RemesPath.cs @@ -956,6 +956,7 @@ JNode arg_outfunc(JNode inp) var dic = new Dictionary(otbl.Length); foreach (KeyValuePair okv in otbl.children) { + all_args[0] = okv.Value; dic[okv.Key] = func.function.Call(all_args); } return new JObject(0, dic); diff --git a/JsonToolsNppPlugin/Properties/AssemblyInfo.cs b/JsonToolsNppPlugin/Properties/AssemblyInfo.cs index 5f3ff51..a75680d 100644 --- a/JsonToolsNppPlugin/Properties/AssemblyInfo.cs +++ b/JsonToolsNppPlugin/Properties/AssemblyInfo.cs @@ -9,7 +9,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Mark Johnston Olson")] [assembly: AssemblyProduct("JSON tools plugin for Notepad++")] -[assembly: AssemblyCopyright("Copyright © molsonkiko 2022-2023")] +[assembly: AssemblyCopyright("Copyright © molsonkiko 2022-2024")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -28,5 +28,5 @@ // Build Number // Revision // -[assembly: AssemblyVersion("6.1.1.1")] -[assembly: AssemblyFileVersion("6.1.1.1")] +[assembly: AssemblyVersion("6.1.1.2")] +[assembly: AssemblyFileVersion("6.1.1.2")] diff --git a/JsonToolsNppPlugin/Tests/RemesPathTests.cs b/JsonToolsNppPlugin/Tests/RemesPathTests.cs index b70ed08..172a745 100644 --- a/JsonToolsNppPlugin/Tests/RemesPathTests.cs +++ b/JsonToolsNppPlugin/Tests/RemesPathTests.cs @@ -266,6 +266,7 @@ public static bool Test() // ufunction tests new Query_DesiredResult("len(@)", fooLen.ToString()), new Query_DesiredResult("s_mul(@.bar.b, 2)", "[\"a`ga`g\", \"bahbah\"]"), + new Query_DesiredResult("s_mul(@.bar.b{foo: s_slice(@[0], 2), bar: s_slice(@[1], :2), baz: a}, len(@.foo))", "{\"foo\": \"ggg\", \"bar\": \"bababa\", \"baz\": \"aaa\"}"), // vectorized arg functions on objects where second and subsequent args are functions of input new Query_DesiredResult("s_lpad(@{ab, aba, d*7}, cd, 5)", "[\"cdcdab\", \"cdaba\", \"ddddddd\"]"), new Query_DesiredResult("s_lpad(@{ab, c*4}, c, 4)", "[\"ccab\", \"cccc\"]"), new Query_DesiredResult("s_rpad(@{ab, aba, d*7}, cd, 5)", "[\"abcdcd\", \"abacd\", \"ddddddd\"]"), diff --git a/docs/RemesPath.md b/docs/RemesPath.md index fedf08c..b2f1606 100644 --- a/docs/RemesPath.md +++ b/docs/RemesPath.md @@ -654,7 +654,20 @@ __Example:__ ### Vectorized functions ### -All of these functions are applied separately to each element in an array or value in an object. +__All of these functions are vectorized across their first argument,__ meaning that when one of these functions is called on an array or object, *any functions in the second and subsequent arguments reference the entire array/object, but the first argument is set to one element at a time.* + +For example, consider the vectorized function `s_mul(s: string, n: int) -> string`. This function concatenates `n` instances of string `s`. +* With __array__ input `["a", "cd", "b"]`, `s_mul(@, len(@))` returns `["aaa", "cdcdcd", "bbb"]` + * The *first argument* references each element of the array separately. + * The *second argument `len(@)` references the entire array*, and is thus `3`, because the array has three elements. + * Because the *first element of the first argument* is `"a"`, the *first element of the output* is `s_mul(a, 3)`, or `"aaa"` + * Because the *second element of the first argument* is `"cd"`, the *second element of the output* is `s_mul(cd, 3)`, or `"cdcdcd"` +* With __object__ input `{"foo": "a", "bar": "cd"}`, `s_mul(@, len(@))` returns `{"foo": "aa", "bar": "cdcd"}` (__NOTE__: this example will fail on JsonTools earlier than [v6.2](/CHANGELOG.md#620---unreleased-yyyy-mm-dd)) + * The *first argument* references each element of the object separately. + * The *second argument `len(@)` references the entire object*, and is thus `2`, because the object has two children. + * Because the *child of key `foo` of the first argument* is `"a"`, the *child of key `foo` of the output* is `s_mul(a, 2)`, or `"aa"` + * Because the *child of key `bar` of the first argument* is `"cd"`, the *child of key `bar` of the output* is `s_mul(cd, 2)`, or `"cdcd"` + All the vectorized string functions have names beginning with `s_`. diff --git a/most recent errors.txt b/most recent errors.txt index e46557a..be60266 100644 --- a/most recent errors.txt +++ b/most recent errors.txt @@ -1,4 +1,4 @@ -Test results for JsonTools v6.1.1.1 on Notepad++ 8.5.8 64bit +Test results for JsonTools v6.1.1.2 on Notepad++ 8.5.8 64bit NOTE: Ctrl-F (regular expressions *on*) for "Failed [1-9]\d*" to find all failed tests Tests failed: YAML dumper ========================= @@ -107,7 +107,7 @@ Testing RemesPath parser and compiler The queried JSON in the RemesParser tests is named foo:{"foo": [[0, 1, 2], [3.0, 4.0, 5.0], [6.0, 7.0, 8.0]], "bar": {"a": false, "b": ["a`g", "bah"]}, "baz": "z", "quz": {}, "jub": [], "guzo": [[[1]], [[2], [3]]], "7": [{"foo": 2}, 1], "_": {"0": 0}} Failed 0 tests. -Passed 472 tests. +Passed 473 tests. ========================= Testing RemesPath throws errors on bad inputs ========================= @@ -195,33 +195,33 @@ Testing JsonParser performance Preview of json: [{"A": "Ky'c^g#~)0", "a": 1850111954, "b": 9318359041, "B": "Oyi:/ xxe2", "C": "sKCSa_^7Gg", "c": 7974777124, "d": 2670309238, "D": "0d_K)HmX!.", "E": ".uM*Z{0EJ_", "e": 6958410336, "f": 8050244728, "F": "1%SG_A!xB\t", "g": 3799657125, "G": "il1^k\\\nat*", "H": {"a": 6079042826, "b": 7292804611, "c" ... -To convert JSON string of size 89556 into JNode took 2.928 +/- 1.267 ms over 32 trials -Load times (ms): 3, 2, 3, 5, 2, 2, 2, 2, 2, 2, 6, 2, 1, 2, 3, 2, 2, 5, 2, 2, 2, 2, 1, 1, 5, 1, 1, 2, 3, 2, 2, 4 +To convert JSON string of size 89556 into JNode took 4.048 +/- 2.229 ms over 32 trials +Load times (ms): 4, 12, 5, 5, 2, 2, 2, 3, 1, 1, 6, 2, 2, 2, 4, 2, 2, 7, 2, 2, 3, 4, 2, 2, 3, 3, 3, 5, 4, 6, 6, 2 ========================= Performance tests for RemesPath (float arithmetic) ========================= -Compiling query "@[@[:].a * @[:].t < @[:].e]" took 0.067 ms the first time, including approximately 0.063 ms to tokenize the query. Subsequent executions are effectively free due to caching. -To run pre-compiled query "@[@[:].a * @[:].t < @[:].e]" on JNode from JSON of size 89556 into took 0.036 +/- 0.01 ms over 40 trials -Query times (ms): 0.066, 0.056, 0.04, 0.041, 0.041, 0.037, 0.052, 0.036, 0.032, 0.037, 0.038, 0.038, 0.023, 0.044, 0.043, 0.04, 0.049, 0.042, 0.04, 0.043, 0.04, 0.043, 0.045, 0.041, 0.039, 0.028, 0.023, 0.031, 0.023, 0.022, 0.023, 0.033, 0.023, 0.023, 0.024, 0.022, 0.023, 0.037, 0.023, 0.023 +Compiling query "@[@[:].a * @[:].t < @[:].e]" took 0.095 ms the first time, including approximately 0.112 ms to tokenize the query. Subsequent executions are effectively free due to caching. +To run pre-compiled query "@[@[:].a * @[:].t < @[:].e]" on JNode from JSON of size 89556 into took 0.044 +/- 0.007 ms over 40 trials +Query times (ms): 0.07, 0.051, 0.038, 0.037, 0.035, 0.036, 0.035, 0.048, 0.045, 0.045, 0.044, 0.046, 0.046, 0.051, 0.042, 0.041, 0.041, 0.042, 0.043, 0.047, 0.044, 0.042, 0.039, 0.041, 0.033, 0.052, 0.061, 0.044, 0.045, 0.044, 0.045, 0.053, 0.041, 0.051, 0.04, 0.042, 0.042, 0.046, 0.042, 0.04 Preview of result: [{"A": "Ky'c^g#~)0", "a": 1850111954, "b": 9318359041, "B": "Oyi:/ xxe2", "C": "sKCSa_^7Gg", "c": 7974777124, "d": 2670309238, "D": "0d_K)HmX!.", "E": ".uM*Z{0EJ_", "e": 6958410336, "f": 8050244728, "F": "1%SG_A!xB\t", "g": 3799657125, "G": "il1^k\\\nat*", "H": {"a": 6079042826, "b": 7292804611, "c" ... ========================= Performance tests for RemesPath (string operations) ========================= -Compiling query "@[@[:].z =~ `(?i)[a-z]{5}`]" took 0.063 ms the first time, including approximately 0.048 ms to tokenize the query. Subsequent executions are effectively free due to caching. -To run pre-compiled query "@[@[:].z =~ `(?i)[a-z]{5}`]" on JNode from JSON of size 89556 into took 0.062 +/- 0.012 ms over 40 trials -Query times (ms): 0.119, 0.083, 0.06, 0.058, 0.06, 0.057, 0.056, 0.058, 0.056, 0.056, 0.057, 0.057, 0.056, 0.06, 0.058, 0.058, 0.057, 0.058, 0.063, 0.066, 0.058, 0.057, 0.059, 0.057, 0.066, 0.059, 0.058, 0.057, 0.057, 0.064, 0.058, 0.057, 0.056, 0.056, 0.056, 0.064, 0.093, 0.064, 0.057, 0.058 +Compiling query "@[@[:].z =~ `(?i)[a-z]{5}`]" took 0.05 ms the first time, including approximately 0.051 ms to tokenize the query. Subsequent executions are effectively free due to caching. +To run pre-compiled query "@[@[:].z =~ `(?i)[a-z]{5}`]" on JNode from JSON of size 89556 into took 0.104 +/- 0.018 ms over 40 trials +Query times (ms): 0.148, 0.105, 0.099, 0.097, 0.191, 0.127, 0.103, 0.101, 0.091, 0.088, 0.09, 0.094, 0.101, 0.122, 0.121, 0.095, 0.092, 0.092, 0.096, 0.099, 0.099, 0.111, 0.094, 0.088, 0.095, 0.104, 0.097, 0.096, 0.109, 0.096, 0.099, 0.114, 0.104, 0.096, 0.097, 0.105, 0.098, 0.099, 0.124, 0.091 Preview of result: [{"A": "\n]o1VQ5t6g", "a": 4710024278, "b": 3268860721, "B": "g4Y7+ew^.v", "C": "NK nmax_notq, `when q=true, nmax = ` + str(nmax_q), `when q=false, nmax= ` + str(nmax_notq))" took 0.257 ms the first time, including approximately 0.183 ms to tokenize the query. Subsequent executions are effectively free due to caching. +ifelse(nmax_q > nmax_notq, `when q=true, nmax = ` + str(nmax_q), `when q=false, nmax= ` + str(nmax_notq))" took 0.21 ms the first time, including approximately 0.202 ms to tokenize the query. Subsequent executions are effectively free due to caching. To run pre-compiled query "var qmask = @[:].q; var nmax_q = max(@[qmask].n); var nmax_notq = max(@[not qmask].n); -ifelse(nmax_q > nmax_notq, `when q=true, nmax = ` + str(nmax_q), `when q=false, nmax= ` + str(nmax_notq))" on JNode from JSON of size 89556 into took 0.039 +/- 0.029 ms over 40 trials -Query times (ms): 0.117, 0.04, 0.031, 0.028, 0.047, 0.046, 0.031, 0.06, 0.031, 0.027, 0.026, 0.069, 0.064, 0.035, 0.043, 0.03, 0.029, 0.18, 0.035, 0.025, 0.025, 0.024, 0.023, 0.044, 0.037, 0.024, 0.053, 0.024, 0.024, 0.024, 0.023, 0.025, 0.024, 0.024, 0.024, 0.024, 0.03, 0.024, 0.025, 0.024 +ifelse(nmax_q > nmax_notq, `when q=true, nmax = ` + str(nmax_q), `when q=false, nmax= ` + str(nmax_notq))" on JNode from JSON of size 89556 into took 0.035 +/- 0.013 ms over 40 trials +Query times (ms): 0.111, 0.035, 0.032, 0.031, 0.032, 0.034, 0.032, 0.031, 0.032, 0.03, 0.031, 0.031, 0.032, 0.032, 0.032, 0.032, 0.032, 0.03, 0.032, 0.032, 0.032, 0.033, 0.032, 0.033, 0.032, 0.033, 0.031, 0.033, 0.035, 0.067, 0.034, 0.033, 0.032, 0.032, 0.032, 0.031, 0.032, 0.031, 0.032, 0.044 Preview of result: "when q=false, nmax= 9830935647.0" ... ========================= @@ -260,11 +260,11 @@ Performance tests for RemesPath (references to compile-time constant variables) Compiling query "var X = X; var onetwo = j`[1, 2]`; -@[:]->at(@, X)->at(@, onetwo)" took 0.137 ms the first time, including approximately 0.363 ms to tokenize the query. Subsequent executions are effectively free due to caching. +@[:]->at(@, X)->at(@, onetwo)" took 0.132 ms the first time, including approximately 0.126 ms to tokenize the query. Subsequent executions are effectively free due to caching. To run pre-compiled query "var X = X; var onetwo = j`[1, 2]`; -@[:]->at(@, X)->at(@, onetwo)" on JNode from JSON of size 89556 into took 0.023 +/- 0.01 ms over 40 trials -Query times (ms): 0.066, 0.022, 0.02, 0.021, 0.02, 0.021, 0.022, 0.022, 0.024, 0.024, 0.024, 0.024, 0.036, 0.024, 0.052, 0.025, 0.025, 0.025, 0.024, 0.026, 0.026, 0.023, 0.021, 0.021, 0.026, 0.026, 0.024, 0.027, 0.018, 0.012, 0.013, 0.012, 0.012, 0.013, 0.012, 0.013, 0.012, 0.013, 0.014, 0.012 +@[:]->at(@, X)->at(@, onetwo)" on JNode from JSON of size 89556 into took 0.027 +/- 0.006 ms over 40 trials +Query times (ms): 0.063, 0.028, 0.025, 0.024, 0.026, 0.024, 0.024, 0.039, 0.025, 0.025, 0.024, 0.025, 0.025, 0.024, 0.024, 0.025, 0.024, 0.024, 0.024, 0.026, 0.025, 0.035, 0.026, 0.025, 0.025, 0.025, 0.024, 0.026, 0.026, 0.025, 0.027, 0.026, 0.026, 0.025, 0.025, 0.034, 0.027, 0.024, 0.026, 0.026 Preview of result: [[1695727848, 0.287562638736685], [2126430375, 0.00767794129708177], [5310550656, 0.380769772645687], [2519183283, 0.153176220930558], [6610062385, 0.662996225870666], [987168256, 0.924410189999928], [6615003609, 0.917112691225947], [4465232046, 0.684311931851536], [8654414565, 0.631485392105992], [ ... ========================= @@ -273,29 +273,29 @@ Performance tests for RemesPath (references to variables that are not compile-ti Compiling query "var X = @->`X`; var onetwo = @{1, 2}; -@[:]->at(@, X)->at(@, onetwo)" took 0.163 ms the first time, including approximately 0.118 ms to tokenize the query. Subsequent executions are effectively free due to caching. +@[:]->at(@, X)->at(@, onetwo)" took 0.128 ms the first time, including approximately 0.439 ms to tokenize the query. Subsequent executions are effectively free due to caching. To run pre-compiled query "var X = @->`X`; var onetwo = @{1, 2}; -@[:]->at(@, X)->at(@, onetwo)" on JNode from JSON of size 89556 into took 0.032 +/- 0.008 ms over 40 trials -Query times (ms): 0.073, 0.031, 0.029, 0.029, 0.03, 0.029, 0.029, 0.047, 0.042, 0.031, 0.056, 0.028, 0.03, 0.029, 0.029, 0.03, 0.029, 0.037, 0.029, 0.029, 0.03, 0.03, 0.029, 0.03, 0.028, 0.029, 0.03, 0.028, 0.031, 0.039, 0.029, 0.03, 0.029, 0.028, 0.029, 0.028, 0.029, 0.031, 0.03, 0.029 +@[:]->at(@, X)->at(@, onetwo)" on JNode from JSON of size 89556 into took 0.037 +/- 0.01 ms over 40 trials +Query times (ms): 0.081, 0.031, 0.046, 0.036, 0.036, 0.036, 0.035, 0.035, 0.037, 0.037, 0.035, 0.037, 0.05, 0.038, 0.038, 0.036, 0.036, 0.034, 0.037, 0.032, 0.033, 0.072, 0.032, 0.036, 0.036, 0.035, 0.033, 0.033, 0.028, 0.028, 0.029, 0.045, 0.032, 0.03, 0.033, 0.033, 0.036, 0.031, 0.031, 0.033 Preview of result: [[1695727848, 0.287562638736685], [2126430375, 0.00767794129708177], [5310550656, 0.380769772645687], [2519183283, 0.153176220930558], [6610062385, 0.662996225870666], [987168256, 0.924410189999928], [6615003609, 0.917112691225947], [4465232046, 0.684311931851536], [8654414565, 0.631485392105992], [ ... ========================= Performance tests for RemesPath (simple string mutations) ========================= -Compiling query "@[:].z = s_sub(@, g, B)" took 0.081 ms the first time, including approximately 0.064 ms to tokenize the query. Subsequent executions are effectively free due to caching. -To run pre-compiled query "@[:].z = s_sub(@, g, B)" on JNode from JSON of size 89556 into took 0.024 +/- 0.011 ms over 40 trials -Query times (ms): 0.027, 0.026, 0.021, 0.025, 0.018, 0.016, 0.03, 0.02, 0.026, 0.03, 0.037, 0.02, 0.021, 0.038, 0.029, 0.038, 0.02, 0.013, 0.013, 0.015, 0.012, 0.012, 0.012, 0.013, 0.014, 0.044, 0.06, 0.044, 0.042, 0.02, 0.016, 0.017, 0.014, 0.014, 0.015, 0.024, 0.03, 0.024, 0.014, 0.018 +Compiling query "@[:].z = s_sub(@, g, B)" took 0.077 ms the first time, including approximately 0.089 ms to tokenize the query. Subsequent executions are effectively free due to caching. +To run pre-compiled query "@[:].z = s_sub(@, g, B)" on JNode from JSON of size 89556 into took 0.031 +/- 0.008 ms over 40 trials +Query times (ms): 0.045, 0.039, 0.038, 0.023, 0.033, 0.026, 0.024, 0.044, 0.03, 0.028, 0.032, 0.038, 0.046, 0.039, 0.053, 0.042, 0.037, 0.033, 0.03, 0.033, 0.028, 0.044, 0.027, 0.023, 0.024, 0.029, 0.023, 0.025, 0.022, 0.026, 0.026, 0.031, 0.026, 0.03, 0.04, 0.027, 0.022, 0.028, 0.022, 0.021 Preview of result: [{"A": "Ky'c^g#~)0", "a": 1850111954, "b": 9318359041, "B": "Oyi:/ xxe2", "C": "sKCSa_^7Gg", "c": 7974777124, "d": 2670309238, "D": "0d_K)HmX!.", "E": ".uM*Z{0EJ_", "e": 6958410336, "f": 8050244728, "F": "1%SG_A!xB\t", "g": 3799657125, "G": "il1^k\\\nat*", "H": {"a": 6079042826, "b": 7292804611, "c" ... ========================= Performance tests for RemesPath (simple number mutations) ========================= -Compiling query "@[:].x = ifelse(@ < 0.5, @ + 3, @ - 3)" took 0.118 ms the first time, including approximately 0.166 ms to tokenize the query. Subsequent executions are effectively free due to caching. -To run pre-compiled query "@[:].x = ifelse(@ < 0.5, @ + 3, @ - 3)" on JNode from JSON of size 89556 into took 0.043 +/- 0.014 ms over 40 trials -Query times (ms): 0.052, 0.045, 0.041, 0.042, 0.04, 0.04, 0.04, 0.047, 0.041, 0.04, 0.039, 0.038, 0.043, 0.065, 0.058, 0.046, 0.047, 0.094, 0.05, 0.052, 0.047, 0.043, 0.041, 0.047, 0.046, 0.049, 0.052, 0.062, 0.057, 0.046, 0.052, 0.031, 0.02, 0.021, 0.02, 0.02, 0.02, 0.021, 0.026, 0.023 +Compiling query "@[:].x = ifelse(@ < 0.5, @ + 3, @ - 3)" took 0.096 ms the first time, including approximately 0.092 ms to tokenize the query. Subsequent executions are effectively free due to caching. +To run pre-compiled query "@[:].x = ifelse(@ < 0.5, @ + 3, @ - 3)" on JNode from JSON of size 89556 into took 0.098 +/- 0.35 ms over 40 trials +Query times (ms): 0.053, 0.044, 0.039, 0.039, 0.047, 0.043, 0.047, 0.051, 0.041, 0.034, 0.041, 0.034, 0.034, 0.035, 0.032, 0.034, 0.034, 0.039, 0.048, 0.044, 0.052, 0.041, 0.042, 0.037, 0.064, 0.04, 0.038, 0.033, 2.281, 0.042, 0.036, 0.038, 0.03, 0.041, 0.039, 0.064, 0.05, 0.055, 0.051, 0.055 Preview of result: [{"A": "Ky'c^g#~)0", "a": 1850111954, "b": 9318359041, "B": "Oyi:/ xxe2", "C": "sKCSa_^7Gg", "c": 7974777124, "d": 2670309238, "D": "0d_K)HmX!.", "E": ".uM*Z{0EJ_", "e": 6958410336, "f": 8050244728, "F": "1%SG_A!xB\t", "g": 3799657125, "G": "il1^k\\\nat*", "H": {"a": 6079042826, "b": 7292804611, "c" ... ========================= @@ -305,12 +305,12 @@ Performance tests for RemesPath (mutations with a for loop) Compiling query "var xhalf = @[:].x < 0.5; for lx = zip(@[:].l, xhalf); lx[0] = ifelse(lx[1], foo, bar); -end for;" took 0.13 ms the first time, including approximately 0.131 ms to tokenize the query. Subsequent executions are effectively free due to caching. +end for;" took 0.249 ms the first time, including approximately 0.201 ms to tokenize the query. Subsequent executions are effectively free due to caching. To run pre-compiled query "var xhalf = @[:].x < 0.5; for lx = zip(@[:].l, xhalf); lx[0] = ifelse(lx[1], foo, bar); -end for;" on JNode from JSON of size 89556 into took 0.061 +/- 0.017 ms over 40 trials -Query times (ms): 0.073, 0.045, 0.044, 0.051, 0.044, 0.042, 0.05, 0.044, 0.043, 0.052, 0.058, 0.094, 0.081, 0.076, 0.079, 0.072, 0.064, 0.046, 0.046, 0.052, 0.097, 0.08, 0.064, 0.078, 0.075, 0.061, 0.064, 0.063, 0.063, 0.066, 0.074, 0.064, 0.061, 0.042, 0.041, 0.108, 0.046, 0.047, 0.045, 0.043 +end for;" on JNode from JSON of size 89556 into took 0.087 +/- 0.016 ms over 40 trials +Query times (ms): 0.111, 0.079, 0.073, 0.076, 0.098, 0.105, 0.084, 0.092, 0.087, 0.114, 0.085, 0.084, 0.086, 0.099, 0.083, 0.09, 0.093, 0.114, 0.111, 0.103, 0.081, 0.115, 0.115, 0.101, 0.073, 0.068, 0.083, 0.077, 0.069, 0.062, 0.094, 0.067, 0.064, 0.069, 0.092, 0.069, 0.064, 0.065, 0.093, 0.074 Preview of result: [["bar", false], ["bar", false], ["foo", true], ["foo", true], ["foo", true], ["foo", true], ["foo", true], ["bar", false], ["bar", false], ["bar", false], ["foo", true], ["foo", true], ["bar", false], ["bar", false], ["foo", true], ["bar", false], ["bar", false], ["bar", false], ["foo", true], ["ba ... ========================= @@ -319,18 +319,18 @@ Testing performance of JSON compression and pretty-printing Preview of json: [{"A": "Ky'c^g#~)0", "a": 1850111954, "b": 9318359041, "B": "Oyi:/ xxe2", "C": "sKCSa_^7Gg", "c": 7974777124, "d": 2670309238, "D": "0d_K)HmX!.", "E": ".uM*Z{0EJ_", "e": 6958410336, "f": 8050244728, "F": "1%SG_A!xB\t", "g": 3799657125, "G": "il1^k\\\nat*", "H": {"a": 6079042826, "b": 7292804611, "c" ... -To compress JNode from JSON string of 89556 took 4.916 +/- 1.023 ms over 64 trials (minimal whitespace, sort_keys=TRUE) -To compress JNode from JSON string of 89556 took 2.077 +/- 0.236 ms over 64 trials (minimal whitespace, sort_keys=FALSE) -To Google-style pretty-print JNode from JSON string of 89556 took 4.607 +/- 0.876 ms over 64 trials (sort_keys=true, indent=4) -To Whitesmith-style pretty-print JNode from JSON string of 89556 took 4.447 +/- 0.394 ms over 64 trials (sort_keys=true, indent=4) -To PPrint-style pretty-print JNode from JSON string of 89556 took 8.872 +/- 1.37 ms over 64 trials (sort_keys=true, indent=4) +To compress JNode from JSON string of 89556 took 4.595 +/- 1.253 ms over 64 trials (minimal whitespace, sort_keys=TRUE) +To compress JNode from JSON string of 89556 took 2.063 +/- 0.24 ms over 64 trials (minimal whitespace, sort_keys=FALSE) +To Google-style pretty-print JNode from JSON string of 89556 took 4.311 +/- 0.408 ms over 64 trials (sort_keys=true, indent=4) +To Whitesmith-style pretty-print JNode from JSON string of 89556 took 4.374 +/- 0.616 ms over 64 trials (sort_keys=true, indent=4) +To PPrint-style pretty-print JNode from JSON string of 89556 took 6.838 +/- 1.01 ms over 64 trials (sort_keys=true, indent=4) ========================= Testing performance of JsonSchemaValidator and random JSON creation ========================= -To create a random set of tweet JSON of size 135815 (15 tweets) based on the matching schema took 8.863 +/- 4.326 ms over 64 trials -To compile the tweet schema to a validation function took 0.439 +/- 0.799 ms over 64 trials -To validate tweet JSON of size 135815 (15 tweets) based on the compiled schema took 1.418 +/- 0.431 ms over 64 trials +To create a random set of tweet JSON of size 202191 (15 tweets) based on the matching schema took 6.484 +/- 3.051 ms over 64 trials +To compile the tweet schema to a validation function took 0.258 +/- 0.35 ms over 64 trials +To validate tweet JSON of size 202191 (15 tweets) based on the compiled schema took 1.076 +/- 0.205 ms over 64 trials ========================= Testing JSON grepper's API request tool =========================