%GSIZE vs %SYS.GlobalQuery for Estimating Size of Globals
Hey everyone,
I stumbled across a comment in this post that mentioned that the %SYS.GlobalQuery is a potentially faster alternative to %GSIZE. I tested it out and while I like the %SYS.GlobalQuery I noticed that it has some size discrepancies against a %GSIZE with details. Can anyone tell me which is more accurate for estimating the size of globals?
Here is an example of one of the differences I saw. From this it looks like the size is estimated to about 70gb from %GSIZE and about 67gb from %SYS.GlobalQuery.
%GSIZE Output:
Ens.MessageBodyD
8830691 70,452,447,461 98 % 8,194,352
%SYS.GlobalQuery Output:
There is also ClassMethod GetGlobalSize in the class %Library.GlobalEdit , where you can select a fast way to count or not, and you will get a different result.
So, when fast, it just counts blocks and don't care how those blocks fill by data and multiply the number of blocks on Size of the block.
Used, counts only when you pass fast=0, and it calculates exact size, and to be more accurate reads all blocks, so it could be slower.
Both methods of calculation give the similar results in fast mode
, while the %Library.GlobalEdit's one seems to be faster. The results of sizing of rather big global are:< restart Caché >
< restart Caché >
I withdrawing the comparison result as my testing environment was not stable (~ %30 "natural" fluctuations due to cloud hosting specific). Planning to repeat the test after getting more stable environment with such a large global(s).