From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id D2DEC5EE9A0; Sun, 3 Sep 2023 13:26:19 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D2DEC5EE9A0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1693736779; bh=NwkO0fjyLSxQjNauIkUIl+I+J+mrY4VBwrWVPGYnwbg=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=cEbDPHDmvpQglOd9nteaUCAukZPTrW3vpp5TqCqQT7+oJKXDjRJE2sA9lA0DAZgXb sgldPoBmr1oRmvDu7UbXqjSNCz+xQmUXu+iZuPfTlzOtNBNbdtUu39pCmOtrTxWdX4 kibjNVqnhUZPugNHF4pfvGudwJKzOj36R7U6cmvA= Received: from smtpng3.i.mail.ru (smtpng3.i.mail.ru [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 0294D4512A0 for ; Sun, 3 Sep 2023 13:26:19 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 0294D4512A0 Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1qckJ8-00059C-0g; Sun, 03 Sep 2023 13:26:18 +0300 Date: Sun, 3 Sep 2023 13:21:35 +0300 To: Maxim Kokryashkin Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD96E142CFC92DB15CD9A78593717343123184EC05241EE6705182A05F5380850400D74FE1E6F5C94A1FA0ACE8420D98D258FC33269C7F59C4ED5BE668283D2697D X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE78887611F2F2455C9EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063706922F90966A37BA8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D845CA578C203DE28236EFE697A5632351117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCC8B02E85A1983BE4A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD1828451B159A507268D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269176DF2183F8FC7C0D75EB778CE7D8A0C68655334FD4449CB33AC447995A7AD1857739F23D657EF2BD5E8D9A59859A8B666D37212B2E9A769089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A58174CAE76231B3E95BF5E19C357D615EA7A26B0606B3661FF87CCE6106E1FC07E67D4AC08A07B9B0CF7CD7A0D5AA5F25CB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF14A44B70FD7C6936B5454819955C998BB28AB4D14FAD60E9E9B40F8E69E3FBE9FDDCA1AF55FC97B2CB50FCC00789692A64D5BA9463DD21756806852E59D9A29FA74DFFEFA5DC0E7F02C26D483E81D6BE5EF9655DD6DEA7D65774BB76CC95456EEC5B5AD62611EEC62B5AFB4261A09AF0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojBdR/qdXWEGM75dAQXZYVzw== X-DA7885C5: 70752FC03E065E013E54D55E02C5BE60258CF3B5923F17F43694F61078899711262E2D401490A4A0DB037EFA58388B346E8BC1A9835FDE71 X-Mailru-Sender: 689FA8AB762F73930F533AC2B33E986BBE20887206971888A10C10456D62B63D0FBE9A32752B8C9C2AA642CC12EC09F1FB559BB5D741EB962F61BD320559CF1EFD657A8799238ED55FEEDEB644C299C0ED14614B50AE0675 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 2/2] profilers: purge generation mechanism X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Maxim! Thanks for the patch! I see improvements in time of the parsing even for small payloads! Nice work! LGTM, with minor nits below. On 28.08.23, Maxim Kokryashkin wrote: > Since both of the profiler parsers are now processing > the events in a stream-like fashion, the generation > mechanism is excessive and can be purged. This results > in a significant memory consumption drop, especially > for the AVL-tree part. > > Follows up tarantool/tarantool#8700 > --- > .../gh-5813-resolving-of-c-symbols.test.lua | 7 ++-- > tools/memprof/parse.lua | 2 +- > tools/sysprof/parse.lua | 9 ++--- > tools/utils/avl.lua | 4 +-- > tools/utils/symtab.lua | 33 +++++++------------ > 5 files changed, 19 insertions(+), 36 deletions(-) > > diff --git a/test/tarantool-tests/gh-5813-resolving-of-c-symbols.test.lua b/test/tarantool-tests/gh-5813-resolving-of-c-symbols.test.lua > index 30b8a3ca..1581ee4b 100644 > --- a/test/tarantool-tests/gh-5813-resolving-of-c-symbols.test.lua > +++ b/test/tarantool-tests/gh-5813-resolving-of-c-symbols.test.lua > @@ -24,12 +24,9 @@ local TMP_BINFILE = profilename("memprofdata.tmp.bin") > diff --git a/tools/memprof/parse.lua b/tools/memprof/parse.lua > index 1b6eceb4..6fd7451b 100644 > --- a/tools/memprof/parse.lua > +++ b/tools/memprof/parse.lua > diff --git a/tools/sysprof/parse.lua b/tools/sysprof/parse.lua > index 451edecb..bb1cb02c 100755 > --- a/tools/sysprof/parse.lua > +++ b/tools/sysprof/parse.lua > @@ -59,7 +59,7 @@ end > local function parse_lfunc(reader, symbols) > local addr = reader:read_uleb128() > local line = reader:read_uleb128() > - local loc = symtab.loc(symbols, { addr = addr, line = line }) > + local loc = symtab.loc{ addr = addr, line = line } Minor: Please, use `()` for function calls. Here and below. > loc.type = FRAME.LFUNC > return symtab.demangle(symbols, loc) > end > @@ -71,7 +71,7 @@ end > > local function parse_cfunc(reader, symbols) > local addr = reader:read_uleb128() > - local loc = symtab.loc(symbols, { addr = addr }) > + local loc = symtab.loc{ addr = addr } > loc.type = FRAME.CFUNC > return symtab.demangle(symbols, loc) > end > @@ -99,7 +99,7 @@ local function parse_host_callchain(reader, event, symbols) > local addr = reader:read_uleb128() > > while addr ~= 0 do > - local loc = symtab.loc(symbols, { addr = addr }) > + local loc = symtab.loc{ addr = addr } > table.insert(event.host.callchain, 1, symtab.demangle(symbols, loc)) > addr = reader:read_uleb128() > end > @@ -113,14 +113,11 @@ local function parse_trace_callchain(reader, event, symbols) > diff --git a/tools/utils/avl.lua b/tools/utils/avl.lua > index d5baa534..81ef9265 100644 > --- a/tools/utils/avl.lua > +++ b/tools/utils/avl.lua > diff --git a/tools/utils/symtab.lua b/tools/utils/symtab.lua > index c26a9e8c..2afd2fd1 100644 > --- a/tools/utils/symtab.lua > +++ b/tools/utils/symtab.lua > @@ -69,9 +60,9 @@ function M.parse_sym_trace(reader, symtab) > > symtab.trace[traceno] = symtab.trace[traceno] or {} > > - table.insert(symtab.trace[traceno], { > - start = M.loc(symtab, { addr = sym_addr, line = sym_line }) > - }) > + symtab.trace[traceno] = { > + start = M.loc{ addr = sym_addr, line = sym_line } > + } > end > > -- Parse a single entry in a symtab: .so library > @@ -136,7 +127,7 @@ end > -- > 2.41.0 > -- Best regards, Sergey Kaplun