Tarantool development patches archive
 help / color / mirror / Atom feed
From: Igor Munkin via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Maxim Kokryashkin <max.kokryashkin@gmail.com>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH luajit v2] sysprof: improve parser's memory footprint
Date: Tue, 18 Jul 2023 08:33:13 +0000	[thread overview]
Message-ID: <ZLZOSYI9OX4eMmds@tarantool.org> (raw)
In-Reply-To: <20230524203513.246808-1-m.kokryashkin@tarantool.org>

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

      parent reply	other threads:[~2023-07-18  8:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-24 20:35 Maxim Kokryashkin via Tarantool-patches
2023-05-24 20:36 ` Maxim Kokryashkin via Tarantool-patches
2023-05-25  9:58   ` Sergey Kaplun via Tarantool-patches
2023-07-18  8:33 ` Igor Munkin via Tarantool-patches [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZLZOSYI9OX4eMmds@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=imun@tarantool.org \
    --cc=max.kokryashkin@gmail.com \
    --subject='Re: [Tarantool-patches] [PATCH luajit v2] sysprof: improve parser'\''s memory footprint' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox