From 1d8cde9d56d153767e98595c4b015221864ef0e7 Mon Sep 17 00:00:00 2001 From: dan Date: Mon, 24 Jun 2024 14:53:14 +0000 Subject: [PATCH] Enhance the output of ".scanstats vm" to include the absolute number of ticks for each VM instruction, instead of just the percentage of the total. FossilOrigin-Name: 1535828335d2b0eccebae952ed2bc70cc0cd893bd4b079d26b80deff9b5f752b --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/shell.c.in | 10 ++++++++-- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/manifest b/manifest index 50a39b8487..31df82fc57 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Revert\sLemon\sso\sthat\sit\sonly\sshows\s-D\soptions\sthat\sare\sactually\sused.\s\sThough\nthe\schange\sto\sdisplay\sthe\soptions\sin\ssorted\sorder\sis\sretained. -D 2024-06-19T18:54:04.609 +C Enhance\sthe\soutput\sof\s".scanstats\svm"\sto\sinclude\sthe\sabsolute\snumber\sof\sticks\sfor\seach\sVM\sinstruction,\sinstead\sof\sjust\sthe\spercentage\sof\sthe\stotal. +D 2024-06-24T14:53:14.332 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -755,7 +755,7 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c F src/resolve.c 7e8d23ce7cdbfedf351a47e759f2722e8182ca10fd7580be43f4ce1f1a228145 F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97 F src/select.c d26ac0a13b4154cbd71a9a57ca024350cd73f0f6fcf0ca0cbb4537e2d5b3e257 -F src/shell.c.in ad27d1d990e9e5fb7ae8fc38a717e91f55233714f59723e5618baf4a2a3d2b65 +F src/shell.c.in 2ccbed6a9fd451399b0f378aafa323ad2286fa9de54ae0cd28f32907cd94d18d F src/sqlite.h.in 6c884a87bbf8828562b49272025a1e66e3801a196a58b0bdec87edcd2c9c8fc1 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h 3f046c04ea3595d6bfda99b781926b17e672fd6d27da2ba6d8d8fc39981dcb54 @@ -2194,8 +2194,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 2aa009c38bb207ac59b9bbd6f8e0d7315697b3fd6a01f9431f29a3c7ccad53e7 -R 3281f4b2c4a24316e0e2a5cf40f57c6f -U drh -Z 4a8e9f1737e4d24d9c6b904079fd66cf +P e54eb217c9508c19aee085b111a1323c9009f014ba4db6019918e27002c4ca8c +R 30630076c85e61c873cb3b13f5a0b068 +U dan +Z b12244e4fa7e207039bd118f17022633 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index fb56f9dd79..a2632ca445 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e54eb217c9508c19aee085b111a1323c9009f014ba4db6019918e27002c4ca8c +1535828335d2b0eccebae952ed2bc70cc0cd893bd4b079d26b80deff9b5f752b diff --git a/src/shell.c.in b/src/shell.c.in index 58475dd6da..a5bfab589b 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -2420,7 +2420,7 @@ static int shell_callback( case MODE_Explain: { static const int aExplainWidth[] = {4, 13, 4, 4, 4, 13, 2, 13}; static const int aExplainMap[] = {0, 1, 2, 3, 4, 5, 6, 7 }; - static const int aScanExpWidth[] = {4, 6, 6, 13, 4, 4, 4, 13, 2, 13}; + static const int aScanExpWidth[] = {4, 15, 6, 13, 4, 4, 4, 13, 2, 13}; static const int aScanExpMap[] = {0, 9, 8, 1, 2, 3, 4, 5, 6, 7 }; const int *aWidth = aExplainWidth; @@ -3430,7 +3430,13 @@ static void display_scanstats( if( pArg->scanstatsOn==3 ){ const char *zSql = " SELECT addr, opcode, p1, p2, p3, p4, p5, comment, nexec," - " round(ncycle*100.0 / (sum(ncycle) OVER ()), 2)||'%' AS cycles" + " format('% 6s (%.2f%%)'," + " CASE WHEN ncycle<100_000 THEN ncycle || ' '" + " WHEN ncycle<100_000_000 THEN (ncycle/1_000) || 'K'" + " WHEN ncycle<100_000_000_000 THEN (ncycle/1_000_000) || 'M'" + " ELSE (ncycle/1000_000_000) || 'G' END," + " ncycle*100.0/(sum(ncycle) OVER ())" + " ) AS cycles" " FROM bytecode(?)"; int rc = SQLITE_OK; -- 2.47.2