[Tarantool-patches] [PATCH luajit v2] sysprof: improve parser's memory footprint

Igor Munkin imun at tarantool.org
Tue Jul 18 11:33:13 MSK 2023


Max,

Thanks for the patch!

My general comment relates to integrational testing. I'd rather left the
stub for tools/sysprof/collapse.lua and remove it in a separate series.
E.g. we update integrational workflows the same way, however hard update
is also an option.

On 24.05.23, Maxim Kokryashkin via Tarantool-patches wrote:
> This patch reduces sysprof's parser memory footprint,
> by avoiding reading all callchains before collapsing them.
> Instead of it, parser merges stacks immediately after
> reading them and stores counts in a lua table.
> 
> Also, it fixes a bug in the AVL-tree implementation,
> which produced unnecessary inserts of values into nodes.

Minor: I guess it's better to split this patch into two: one fixing the
bug in AVL tree, and another one for reducing memory footprint. AFAIU,
you stop using tables to store nodes and this decision affects several
parts of the sources, making review a bit harder. Hence, it's only
partial for now and I'm waiting for v3 series.

Side note: Honestly, I'd rather split this into three patches:
1. AVL-related fixes
2. Reducing memory footprint
3. Purging collapse.lua

The order doesn't matter (until it follows the common sense and breaks
nothing).

> ---
> 
> Changes in v2:
> - Fixed comments as per review by Sergey.
> 
> Branch: https://github.com/tarantool/luajit/tree/fckxorg/gh-8700-sysprof-parser-refactoring
> PR: https://github.com/tarantool/tarantool/pull/8703
> 
>  tools/CMakeLists.txt       |   2 -
>  tools/sysprof.lua          |  27 +-------
>  tools/sysprof/collapse.lua | 124 ------------------------------------
>  tools/sysprof/parse.lua    | 127 +++++++++++++++++++++++++++----------
>  tools/utils/avl.lua        |   2 +-
>  tools/utils/symtab.lua     |   2 +-
>  6 files changed, 97 insertions(+), 187 deletions(-)
>  delete mode 100755 tools/sysprof/collapse.lua

<snipped>

> diff --git a/tools/sysprof.lua b/tools/sysprof.lua
> index 1afab195..be2a0565 100644
> --- a/tools/sysprof.lua
> +++ b/tools/sysprof.lua

<snipped>

>  
> +  for stack, count in pairs(events) do
> +    print(stack, count)

Minor: Previous implementation was space separated, the current on is
tab separated. Dunno, whether this is OK.

> +  end
>    os.exit(0)
>  end

<snipped>

> -- 
> 2.40.1
> 

-- 
Best regards,
IM


More information about the Tarantool-patches mailing list