diff --git a/CHANGELOG.md b/CHANGELOG.md index 858ef0f..544ecac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,6 +54,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Added 1. Made the tree view font size configurable with the [`tree_view_font_size` setting](/docs/README.md#styling-of-forms). Fixes [issue 66](https://github.com/molsonkiko/JsonToolsNppPlugin/issues/66). +2. Added dark mode tree view icons (addresses [this GH issue comment](https://github.com/molsonkiko/JsonToolsNppPlugin/issues/66#issuecomment-2169216078)). ### Fixed diff --git a/JsonToolsNppPlugin/Forms/TreeViewer.Designer.cs b/JsonToolsNppPlugin/Forms/TreeViewer.Designer.cs index e4a45b6..9d5d74a 100644 --- a/JsonToolsNppPlugin/Forms/TreeViewer.Designer.cs +++ b/JsonToolsNppPlugin/Forms/TreeViewer.Designer.cs @@ -96,6 +96,13 @@ private void InitializeComponent() this.TypeIconList.Images.SetKeyName(5, "object type icon.PNG"); this.TypeIconList.Images.SetKeyName(6, "string type icon.PNG"); this.TypeIconList.Images.SetKeyName(7, "null type icon.PNG"); + this.TypeIconList.Images.SetKeyName(8, "array type icon darkmode.PNG"); + this.TypeIconList.Images.SetKeyName(9, "bool type icon darkmode.PNG"); + this.TypeIconList.Images.SetKeyName(10, "date type icon darkmode.PNG"); + this.TypeIconList.Images.SetKeyName(11, "float type icon darkmode.PNG"); + this.TypeIconList.Images.SetKeyName(12, "int type icon darkmode.PNG"); + this.TypeIconList.Images.SetKeyName(13, "object type icon darkmode.PNG"); + this.TypeIconList.Images.SetKeyName(14, "string type icon darkmode.PNG"); // // QueryBox // diff --git a/JsonToolsNppPlugin/Forms/TreeViewer.cs b/JsonToolsNppPlugin/Forms/TreeViewer.cs index 06e7441..07145ef 100644 --- a/JsonToolsNppPlugin/Forms/TreeViewer.cs +++ b/JsonToolsNppPlugin/Forms/TreeViewer.cs @@ -66,6 +66,11 @@ public partial class TreeViewer : Form /// the most recently used quote character for s_csv in a RemesPath query public char csvQuote; + /// + /// whether to use dark mode type icons + /// + public bool isDarkMode = false; + // event handlers for the node mouseclick drop down menu private static MouseEventHandler valToClipboardHandler = null; private static MouseEventHandler pathToClipboardHandler_Remespath = null; @@ -211,20 +216,23 @@ private void QueryBox_KeyPress(object sender, KeyPressEventArgs e) // TODO: maybe add some way to highlight unclosed braces? } - public static void SetImageOfTreeNode(TreeNode root, JNode json) + public static void SetImageOfTreeNode(TreeNode root, JNode json, bool isDarkMode) { + int imageIndex = isDarkMode ? 8 : 0; switch (json.type) { - case Dtype.ARR: root.ImageIndex = 0; root.SelectedImageIndex = 0; break; - case Dtype.BOOL: root.ImageIndex = 1; root.SelectedImageIndex = 1; break; + case Dtype.ARR: imageIndex += 0; break; + case Dtype.BOOL: imageIndex += 1; break; case Dtype.DATE: - case Dtype.DATETIME: root.ImageIndex = 2; root.SelectedImageIndex = 2; break; - case Dtype.FLOAT: root.ImageIndex = 3; root.SelectedImageIndex = 3; break; - case Dtype.INT: root.ImageIndex = 4; root.SelectedImageIndex = 4; break; - case Dtype.OBJ: root.ImageIndex = 5; root.SelectedImageIndex = 5; break; - case Dtype.STR: root.ImageIndex = 6; root.SelectedImageIndex = 6; break; - default: root.ImageIndex = 7; root.SelectedImageIndex = 7; break; + case Dtype.DATETIME: imageIndex += 2; break; + case Dtype.FLOAT: imageIndex += 3; break; + case Dtype.INT: imageIndex += 4; break; + case Dtype.OBJ: imageIndex += 5; break; + case Dtype.STR: imageIndex += 6; break; + default: imageIndex = 7; break; // null type icon is same for light and dark mode } + root.ImageIndex = imageIndex; + root.SelectedImageIndex = imageIndex; } public void JsonTreePopulate(JNode json, TreeView tree = null) @@ -256,7 +264,7 @@ public void JsonTreePopulate(JNode json, TreeView tree = null) pathsToJNodes.Clear(); TreeNode root = new TreeNode(); if (Main.settings.tree_node_images) - SetImageOfTreeNode(root, json); + SetImageOfTreeNode(root, json, isDarkMode); if (json is JArray arr) { root.Text = TextForTreeNode("JSON", json); @@ -286,6 +294,29 @@ public void JsonTreePopulate(JNode json, TreeView tree = null) pathsToJNodes[root.FullPath] = json; } + public void ToggleIconDarkMode(bool newIsDarkMode) + { + if (newIsDarkMode == isDarkMode) + return; + Tree.BeginUpdate(); + isDarkMode = newIsDarkMode; + if (Tree.Nodes.Count > 0) + ToggleIconDarkModeHelper(Tree.Nodes[0], isDarkMode); + Tree.EndUpdate(); + } + + private static void ToggleIconDarkModeHelper(TreeNode node, bool isDarkMode) + { + if (node.ImageIndex != 7) // null type icon is same for dark and light mode + { + int imageIndexChange = isDarkMode ? +8 : -8; + node.ImageIndex += imageIndexChange; + node.SelectedImageIndex += imageIndexChange; + } + foreach (TreeNode child in node.Nodes) + ToggleIconDarkModeHelper(child, isDarkMode); + } + public static int IntervalBetweenJNodesWithTreeNodes(JNode json) { int interval = 0; @@ -310,7 +341,8 @@ private static void JsonTreePopulateHelper_DirectChildren(TreeView tree, TreeNode root, JNode json, Dictionary pathsToJNodes, - bool usesSelections) + bool usesSelections, + bool isDarkMode) { tree.BeginUpdate(); try @@ -330,7 +362,7 @@ private static void JsonTreePopulateHelper_DirectChildren(TreeView tree, childNode.Nodes.Add(""); } if (Main.settings.tree_node_images) - SetImageOfTreeNode(childNode, child); + SetImageOfTreeNode(childNode, child, isDarkMode); pathsToJNodes[childNode.FullPath] = child; } } @@ -351,7 +383,7 @@ private static void JsonTreePopulateHelper_DirectChildren(TreeView tree, childNode.Nodes.Add(""); } if (Main.settings.tree_node_images) - SetImageOfTreeNode(childNode, child); + SetImageOfTreeNode(childNode, child, isDarkMode); pathsToJNodes[childNode.FullPath] = child; } } @@ -706,7 +738,7 @@ private void ReplaceSentinelWithChildren(TreeView tree, TreeNode node) { nodes.RemoveAt(0); JNode jnode = pathsToJNodes[node.FullPath]; - JsonTreePopulateHelper_DirectChildren(tree, node, jnode, pathsToJNodes, UsesSelections()); + JsonTreePopulateHelper_DirectChildren(tree, node, jnode, pathsToJNodes, UsesSelections(), isDarkMode); } } @@ -725,7 +757,8 @@ private static void JsonTreePopulate_FullRecursive(TreeView tree, TreeNode root, JNode json, Dictionary pathsToJNodes, - bool usesSelections) + bool usesSelections, + bool isDarkMode) { int interval = IntervalBetweenJNodesWithTreeNodes(json); if (HasSentinelChild(root)) @@ -743,7 +776,7 @@ private static void JsonTreePopulate_FullRecursive(TreeView tree, JNode child = jar[ii]; TreeNode childNode = root.Nodes.Add(TextForTreeNode(ii.ToString(), child)); if (Main.settings.tree_node_images) - SetImageOfTreeNode(childNode, child); + SetImageOfTreeNode(childNode, child, isDarkMode); pathsToJNodes[childNode.FullPath] = child; } } @@ -759,7 +792,7 @@ private static void JsonTreePopulate_FullRecursive(TreeView tree, JNode child = jobj[key]; TreeNode childNode = root.Nodes.Add(key, TextForTreeNode(key, child)); if (Main.settings.tree_node_images) - SetImageOfTreeNode(childNode, child); + SetImageOfTreeNode(childNode, child, isDarkMode); pathsToJNodes[childNode.FullPath] = child; } } @@ -784,7 +817,7 @@ private static void JsonTreePopulate_FullRecursive(TreeView tree, if ((child is JArray childarr && childarr.Length > 0) || (child is JObject childobj && childobj.Length > 0)) { - JsonTreePopulate_FullRecursive(tree, childNode, child, pathsToJNodes, false); + JsonTreePopulate_FullRecursive(tree, childNode, child, pathsToJNodes, false, isDarkMode); } } } @@ -799,7 +832,7 @@ private static void JsonTreePopulate_FullRecursive(TreeView tree, if ((child is JArray childarr && childarr.Length > 0) || (child is JObject childobj && childobj.Length > 0)) { - JsonTreePopulate_FullRecursive(tree, childNode, child, pathsToJNodes, false); + JsonTreePopulate_FullRecursive(tree, childNode, child, pathsToJNodes, false, isDarkMode); } } } @@ -961,7 +994,7 @@ private void Tree_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) // node.ExpandAll() is VERY VERY SLOW if we don't do it this way Tree.BeginUpdate(); isExpandingAllSubtrees = true; - JsonTreePopulate_FullRecursive(Tree, node, nodeJson, pathsToJNodes, UsesSelections()); + JsonTreePopulate_FullRecursive(Tree, node, nodeJson, pathsToJNodes, UsesSelections(), isDarkMode); node.ExpandAll(); isExpandingAllSubtrees = false; Tree.EndUpdate(); diff --git a/JsonToolsNppPlugin/Forms/TreeViewer.resx b/JsonToolsNppPlugin/Forms/TreeViewer.resx index a9e0f2d..b0cc4e7 100644 --- a/JsonToolsNppPlugin/Forms/TreeViewer.resx +++ b/JsonToolsNppPlugin/Forms/TreeViewer.resx @@ -124,9 +124,9 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 - ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADC - CgAAAk1TRnQBSQFMAgEBCAEAAcABAQHAAQEBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo - AwABQAMAATADAAEBAQABCAYAAQwYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA + ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACw + DgAAAk1TRnQBSQFMAgEBDwEAAcgBAQHIAQEBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + AwABQAMAAUADAAEBAQABCAYAARAYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA AWYDAAGZAwABzAIAATMDAAIzAgABMwFmAgABMwGZAgABMwHMAgABMwH/AgABZgMAAWYBMwIAAmYCAAFm @@ -153,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/wHjBf8B8gGL + AbsD/wKLCP8BEQUAAv8B8AHxBf8BFAPsARUC7AEAAuwBAAHxCP8B4wEWA/8C+Qb/AfIBiwG7A/8Ciwj/ + AZIDAAHsARUBQwH/AW0G/wGSCuwB8wn/AfkD/wHjB/8B8gGLAbsD/wKLCf8DAAH/AfIBAAH/AQAG/wEU + CgAB8Qf/ARYBvQH5A/8BFwGUBv8B8gKLAc8B/wOLCf8BEwIAAQ4BAAHrARQBBwb/ARQBDgEHAf8EAAHx + Af8BAAHxCP8BvQT/Ar0Y/wERAgABEQEOAewH/wLwAQAB8gQHAeoCByn/AfIB7AGSAfQK/wH0Bf8B9JX/ + AUIBTQE+BwABPgMAASgDAAFAAwABQAMAAQEBAAEBBgABAhYAA///AP8AAwAL 303, 10 - 25 + 69 diff --git a/JsonToolsNppPlugin/Properties/AssemblyInfo.cs b/JsonToolsNppPlugin/Properties/AssemblyInfo.cs index 22c1e69..efd8a72 100644 --- a/JsonToolsNppPlugin/Properties/AssemblyInfo.cs +++ b/JsonToolsNppPlugin/Properties/AssemblyInfo.cs @@ -28,5 +28,5 @@ // Build Number // Revision // -[assembly: AssemblyVersion("7.2.0.1")] -[assembly: AssemblyFileVersion("7.2.0.1")] +[assembly: AssemblyVersion("7.2.0.2")] +[assembly: AssemblyFileVersion("7.2.0.2")] diff --git a/JsonToolsNppPlugin/Resources/array type icon darkmode.PNG b/JsonToolsNppPlugin/Resources/array type icon darkmode.PNG new file mode 100644 index 0000000..a02c84c Binary files /dev/null and b/JsonToolsNppPlugin/Resources/array type icon darkmode.PNG differ diff --git a/JsonToolsNppPlugin/Resources/bool type icon darkmode.PNG b/JsonToolsNppPlugin/Resources/bool type icon darkmode.PNG new file mode 100644 index 0000000..ad6d433 Binary files /dev/null and b/JsonToolsNppPlugin/Resources/bool type icon darkmode.PNG differ diff --git a/JsonToolsNppPlugin/Resources/date type icon darkmode.PNG b/JsonToolsNppPlugin/Resources/date type icon darkmode.PNG new file mode 100644 index 0000000..8e29a62 Binary files /dev/null and b/JsonToolsNppPlugin/Resources/date type icon darkmode.PNG differ diff --git a/JsonToolsNppPlugin/Resources/float type icon darkmode.PNG b/JsonToolsNppPlugin/Resources/float type icon darkmode.PNG new file mode 100644 index 0000000..7d3baf3 Binary files /dev/null and b/JsonToolsNppPlugin/Resources/float type icon darkmode.PNG differ diff --git a/JsonToolsNppPlugin/Resources/int type icon darkmode.PNG b/JsonToolsNppPlugin/Resources/int type icon darkmode.PNG new file mode 100644 index 0000000..4ad8be8 Binary files /dev/null and b/JsonToolsNppPlugin/Resources/int type icon darkmode.PNG differ diff --git a/JsonToolsNppPlugin/Resources/object type icon darkmode.PNG b/JsonToolsNppPlugin/Resources/object type icon darkmode.PNG new file mode 100644 index 0000000..dbd56b8 Binary files /dev/null and b/JsonToolsNppPlugin/Resources/object type icon darkmode.PNG differ diff --git a/JsonToolsNppPlugin/Resources/string type icon darkmode.PNG b/JsonToolsNppPlugin/Resources/string type icon darkmode.PNG new file mode 100644 index 0000000..7c01997 Binary files /dev/null and b/JsonToolsNppPlugin/Resources/string type icon darkmode.PNG differ diff --git a/JsonToolsNppPlugin/Utils/FormStyle.cs b/JsonToolsNppPlugin/Utils/FormStyle.cs index fe346d4..d14fb2e 100644 --- a/JsonToolsNppPlugin/Utils/FormStyle.cs +++ b/JsonToolsNppPlugin/Utils/FormStyle.cs @@ -1,4 +1,5 @@ -using System; +using Kbg.NppPluginNET; +using System; using System.Drawing; using System.Reflection; using System.Windows.Forms; @@ -34,6 +35,12 @@ public static void ApplyStyle(Control ctrl, bool useNppStyle, bool darkMode = fa } } Color backColor = Npp.notepad.GetDefaultBackgroundColor(); + if (ctrl is Forms.TreeViewer trev) + { + // determine whether to use dark mode icons (use if NPP background is very dark) + bool newIsDarkMode = useNppStyle && backColor.R <= 66 && backColor.G <= 66 && backColor.B <= 66; + trev.ToggleIconDarkMode(newIsDarkMode); + } if (!useNppStyle || ( backColor.R > 240 && backColor.G > 240 && diff --git a/README.md b/README.md index db872e8..786d450 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ If you have any issues, see if [updating to the latest release](https://github.c * [Python-style comments](/CHANGELOG.md#4120---2023-03-28) * Missing commas and colons * Unterminated strings, arrays, and objects -5. [Get the path to the current line](/docs/README.md#path-to-current-line) +5. [Get the path to the current position](/docs/README.md#path-to-current-position) 6. Query and edit JSON with: * a [find/replace form](/docs/README.md#find-and-replace-form) * an [array sorting form](/docs/README.md#sort-form) diff --git a/most recent errors.txt b/most recent errors.txt index d038241..0591d78 100644 --- a/most recent errors.txt +++ b/most recent errors.txt @@ -1,4 +1,4 @@ -Test results for JsonTools v7.2.0.1 on Notepad++ 8.6.4 64bit +Test results for JsonTools v7.2.0.2 on Notepad++ 8.6.4 64bit NOTE: Ctrl-F (regular expressions *on*) for "Failed [1-9]\d*" to find all failed tests Tests failed: YAML dumper ========================= @@ -201,33 +201,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.552 +/- 1.532 ms over 32 trials -Load times (ms): 2, 2, 2, 3, 1, 2, 5, 9, 2, 2, 3, 1, 1, 4, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 4, 1, 1, 1, 2, 2, 1, 3 +To convert JSON string of size 89556 into JNode took 2.444 +/- 1.693 ms over 32 trials +Load times (ms): 3, 10, 1, 3, 1, 1, 1, 2, 1, 1, 4, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 4, 1, 1, 1, 2, 1, 1, 4, 1, 1, 1 ========================= Performance tests for RemesPath (float arithmetic) ========================= -Compiling query "@[@[:].a * @[:].t < @[:].e]" took 0.054 ms the first time, including approximately 0.057 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.031 +/- 0.006 ms over 40 trials -Query times (ms): 0.056, 0.033, 0.023, 0.023, 0.03, 0.023, 0.023, 0.026, 0.024, 0.023, 0.023, 0.023, 0.023, 0.026, 0.023, 0.023, 0.034, 0.038, 0.031, 0.039, 0.031, 0.032, 0.031, 0.034, 0.031, 0.034, 0.031, 0.034, 0.032, 0.031, 0.034, 0.034, 0.034, 0.031, 0.035, 0.031, 0.032, 0.033, 0.038, 0.032 +Compiling query "@[@[:].a * @[:].t < @[:].e]" took 0.067 ms the first time, including approximately 0.056 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.026 +/- 0.007 ms over 40 trials +Query times (ms): 0.051, 0.044, 0.023, 0.05, 0.022, 0.023, 0.022, 0.024, 0.023, 0.024, 0.022, 0.022, 0.023, 0.024, 0.023, 0.023, 0.024, 0.023, 0.022, 0.024, 0.023, 0.023, 0.022, 0.022, 0.046, 0.024, 0.023, 0.024, 0.023, 0.023, 0.022, 0.024, 0.023, 0.023, 0.023, 0.024, 0.023, 0.024, 0.023, 0.024 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.046 ms the first time, including approximately 0.044 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.073 +/- 0.013 ms over 40 trials -Query times (ms): 0.089, 0.066, 0.06, 0.069, 0.06, 0.065, 0.106, 0.078, 0.076, 0.06, 0.067, 0.065, 0.07, 0.064, 0.076, 0.118, 0.107, 0.075, 0.07, 0.071, 0.064, 0.066, 0.064, 0.068, 0.063, 0.068, 0.07, 0.08, 0.069, 0.062, 0.069, 0.07, 0.075, 0.065, 0.071, 0.063, 0.071, 0.078, 0.089, 0.064 +Compiling query "@[@[:].z =~ `(?i)[a-z]{5}`]" took 0.035 ms the first time, including approximately 0.038 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.055 +/- 0.008 ms over 40 trials +Query times (ms): 0.088, 0.057, 0.087, 0.056, 0.077, 0.053, 0.053, 0.052, 0.052, 0.052, 0.053, 0.052, 0.052, 0.053, 0.053, 0.052, 0.053, 0.053, 0.061, 0.053, 0.053, 0.052, 0.053, 0.053, 0.052, 0.053, 0.053, 0.052, 0.053, 0.052, 0.053, 0.052, 0.053, 0.052, 0.054, 0.053, 0.053, 0.053, 0.052, 0.053 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.134 ms the first time, including approximately 0.146 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.137 ms the first time, including approximately 0.124 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.023 +/- 0.012 ms over 40 trials -Query times (ms): 0.074, 0.02, 0.017, 0.018, 0.017, 0.016, 0.018, 0.018, 0.017, 0.018, 0.018, 0.018, 0.018, 0.026, 0.026, 0.04, 0.018, 0.046, 0.018, 0.017, 0.017, 0.016, 0.019, 0.019, 0.022, 0.019, 0.02, 0.02, 0.018, 0.02, 0.027, 0.03, 0.063, 0.024, 0.023, 0.02, 0.027, 0.017, 0.016, 0.016 +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.017 +/- 0.009 ms over 40 trials +Query times (ms): 0.076, 0.018, 0.016, 0.016, 0.016, 0.016, 0.016, 0.016, 0.015, 0.016, 0.016, 0.016, 0.016, 0.016, 0.016, 0.015, 0.015, 0.016, 0.016, 0.016, 0.016, 0.015, 0.016, 0.015, 0.016, 0.015, 0.016, 0.015, 0.016, 0.016, 0.016, 0.016, 0.016, 0.015, 0.015, 0.015, 0.016, 0.016, 0.015, 0.015 Preview of result: "when q=false, nmax= 9830935647.0" ... ========================= @@ -266,11 +266,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.07 ms the first time, including approximately 0.069 ms to tokenize the query. Subsequent executions are effectively free due to caching. +@[:]->at(@, X)->at(@, onetwo)" took 0.079 ms the first time, including approximately 0.11 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.021 +/- 0.054 ms over 40 trials -Query times (ms): 0.035, 0.014, 0.012, 0.012, 0.012, 0.012, 0.012, 0.012, 0.359, 0.016, 0.012, 0.012, 0.011, 0.012, 0.012, 0.011, 0.012, 0.012, 0.012, 0.012, 0.012, 0.013, 0.012, 0.011, 0.012, 0.012, 0.012, 0.012, 0.012, 0.013, 0.012, 0.011, 0.012, 0.012, 0.011, 0.012, 0.011, 0.012, 0.012, 0.012 +@[:]->at(@, X)->at(@, onetwo)" on JNode from JSON of size 89556 into took 0.013 +/- 0.005 ms over 40 trials +Query times (ms): 0.039, 0.013, 0.012, 0.012, 0.012, 0.011, 0.012, 0.012, 0.011, 0.012, 0.031, 0.011, 0.012, 0.012, 0.012, 0.012, 0.011, 0.012, 0.012, 0.011, 0.012, 0.011, 0.012, 0.012, 0.011, 0.012, 0.012, 0.011, 0.012, 0.012, 0.012, 0.012, 0.012, 0.012, 0.012, 0.011, 0.012, 0.011, 0.012, 0.012 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], [ ... ========================= @@ -279,29 +279,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.073 ms the first time, including approximately 0.07 ms to tokenize the query. Subsequent executions are effectively free due to caching. +@[:]->at(@, X)->at(@, onetwo)" took 0.082 ms the first time, including approximately 0.076 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.016 +/- 0.003 ms over 40 trials -Query times (ms): 0.032, 0.017, 0.016, 0.016, 0.016, 0.016, 0.016, 0.016, 0.016, 0.016, 0.016, 0.015, 0.016, 0.016, 0.015, 0.016, 0.016, 0.015, 0.016, 0.016, 0.016, 0.016, 0.016, 0.015, 0.016, 0.016, 0.016, 0.016, 0.016, 0.015, 0.016, 0.016, 0.016, 0.016, 0.016, 0.016, 0.016, 0.016, 0.016, 0.016 +@[:]->at(@, X)->at(@, onetwo)" on JNode from JSON of size 89556 into took 0.024 +/- 0.043 ms over 40 trials +Query times (ms): 0.053, 0.017, 0.016, 0.016, 0.016, 0.016, 0.016, 0.016, 0.016, 0.015, 0.016, 0.016, 0.016, 0.016, 0.016, 0.288, 0.021, 0.016, 0.015, 0.016, 0.016, 0.015, 0.016, 0.016, 0.015, 0.016, 0.016, 0.015, 0.016, 0.016, 0.015, 0.015, 0.015, 0.015, 0.016, 0.015, 0.015, 0.016, 0.016, 0.015 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.038 ms the first time, including approximately 0.036 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.014 +/- 0.004 ms over 40 trials -Query times (ms): 0.022, 0.017, 0.011, 0.009, 0.009, 0.011, 0.012, 0.011, 0.01, 0.012, 0.012, 0.012, 0.028, 0.022, 0.018, 0.025, 0.014, 0.016, 0.012, 0.023, 0.011, 0.011, 0.011, 0.012, 0.011, 0.013, 0.011, 0.011, 0.011, 0.017, 0.012, 0.011, 0.011, 0.013, 0.012, 0.012, 0.012, 0.011, 0.012, 0.012 +Compiling query "@[:].z = s_sub(@, g, B)" took 0.061 ms the first time, including approximately 0.057 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.014 +/- 0.005 ms over 40 trials +Query times (ms): 0.025, 0.011, 0.011, 0.029, 0.032, 0.013, 0.019, 0.013, 0.013, 0.015, 0.014, 0.014, 0.015, 0.013, 0.013, 0.014, 0.013, 0.016, 0.011, 0.011, 0.012, 0.011, 0.012, 0.011, 0.011, 0.01, 0.011, 0.012, 0.011, 0.013, 0.018, 0.01, 0.012, 0.011, 0.012, 0.013, 0.011, 0.011, 0.011, 0.01 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.072 ms the first time, including approximately 0.076 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.022 +/- 0.009 ms over 40 trials -Query times (ms): 0.065, 0.036, 0.022, 0.018, 0.021, 0.023, 0.018, 0.018, 0.018, 0.017, 0.018, 0.017, 0.026, 0.021, 0.022, 0.018, 0.018, 0.018, 0.019, 0.019, 0.018, 0.019, 0.019, 0.02, 0.023, 0.024, 0.044, 0.027, 0.019, 0.018, 0.018, 0.018, 0.019, 0.018, 0.02, 0.018, 0.018, 0.016, 0.017, 0.026 +Compiling query "@[:].x = ifelse(@ < 0.5, @ + 3, @ - 3)" took 0.084 ms the first time, including approximately 0.073 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.033 +/- 0.038 ms over 40 trials +Query times (ms): 0.044, 0.052, 0.035, 0.02, 0.256, 0.02, 0.017, 0.021, 0.019, 0.019, 0.029, 0.021, 0.023, 0.055, 0.077, 0.05, 0.054, 0.041, 0.036, 0.038, 0.035, 0.022, 0.019, 0.018, 0.018, 0.019, 0.019, 0.019, 0.032, 0.025, 0.021, 0.018, 0.018, 0.02, 0.018, 0.018, 0.018, 0.017, 0.019, 0.017 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" ... ========================= @@ -311,12 +311,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.135 ms the first time, including approximately 0.17 ms to tokenize the query. Subsequent executions are effectively free due to caching. +end for;" took 0.203 ms the first time, including approximately 0.165 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.051 +/- 0.019 ms over 40 trials -Query times (ms): 0.073, 0.043, 0.04, 0.072, 0.042, 0.038, 0.038, 0.038, 0.04, 0.039, 0.063, 0.052, 0.046, 0.039, 0.039, 0.038, 0.04, 0.037, 0.034, 0.036, 0.038, 0.038, 0.038, 0.038, 0.039, 0.039, 0.036, 0.058, 0.052, 0.074, 0.063, 0.043, 0.128, 0.088, 0.093, 0.05, 0.056, 0.074, 0.057, 0.046 +end for;" on JNode from JSON of size 89556 into took 0.046 +/- 0.015 ms over 40 trials +Query times (ms): 0.075, 0.047, 0.039, 0.038, 0.039, 0.04, 0.035, 0.034, 0.033, 0.047, 0.049, 0.048, 0.05, 0.048, 0.042, 0.036, 0.036, 0.036, 0.038, 0.037, 0.038, 0.115, 0.055, 0.056, 0.05, 0.052, 0.048, 0.048, 0.04, 0.039, 0.037, 0.037, 0.037, 0.038, 0.076, 0.056, 0.064, 0.043, 0.037, 0.037 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 ... ========================= @@ -325,18 +325,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 3.96 +/- 0.498 ms over 64 trials (minimal whitespace, sortKeys=TRUE) -To compress JNode from JSON string of 89556 took 2.007 +/- 0.25 ms over 64 trials (minimal whitespace, sortKeys=FALSE) -To Google-style pretty-print JNode from JSON string of 89556 took 4.437 +/- 0.586 ms over 64 trials (sortKeys=true, indent=4) -To Whitesmith-style pretty-print JNode from JSON string of 89556 took 4.836 +/- 1.387 ms over 64 trials (sortKeys=true, indent=4) -To PPrint-style pretty-print JNode from JSON string of 89556 took 5.782 +/- 0.434 ms over 64 trials (sortKeys=true, indent=4) +To compress JNode from JSON string of 89556 took 3.859 +/- 0.602 ms over 64 trials (minimal whitespace, sortKeys=TRUE) +To compress JNode from JSON string of 89556 took 1.937 +/- 0.305 ms over 64 trials (minimal whitespace, sortKeys=FALSE) +To Google-style pretty-print JNode from JSON string of 89556 took 4.932 +/- 1.256 ms over 64 trials (sortKeys=true, indent=4) +To Whitesmith-style pretty-print JNode from JSON string of 89556 took 4.155 +/- 0.549 ms over 64 trials (sortKeys=true, indent=4) +To PPrint-style pretty-print JNode from JSON string of 89556 took 5.807 +/- 0.249 ms over 64 trials (sortKeys=true, indent=4) ========================= Testing performance of JsonSchemaValidator and random JSON creation ========================= -To create a random set of tweet JSON of size 175207 (15 tweets) based on the matching schema took 6.841 +/- 3.741 ms over 64 trials -To compile the tweet schema to a validation function took 0.312 +/- 0.56 ms over 64 trials -To validate tweet JSON of size 175207 (15 tweets) based on the compiled schema took 1.044 +/- 0.311 ms over 64 trials +To create a random set of tweet JSON of size 143859 (15 tweets) based on the matching schema took 6.198 +/- 3.004 ms over 64 trials +To compile the tweet schema to a validation function took 0.345 +/- 0.813 ms over 64 trials +To validate tweet JSON of size 143859 (15 tweets) based on the compiled schema took 1.011 +/- 0.344 ms over 64 trials ========================= Testing JSON grepper's API request tool ========================= diff --git a/testfiles/small/JSON lines example.jsonl b/testfiles/small/JSON lines example.jsonl index 4bdd595..a46751e 100644 --- a/testfiles/small/JSON lines example.jsonl +++ b/testfiles/small/JSON lines example.jsonl @@ -1,5 +1,5 @@ [1, 2] ["a", "b"] -{"a": 1, "b": 2, "c": [3]} +{"a": null, "b": false, "c": [3]} "d" 1.5 \ No newline at end of file