Tarantool development patches archive
 help / color / mirror / Atom feed
From: Mikhail Shishatskiy via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: "Sergey Kaplun" <skaplun@tarantool.org>,
	"Igor Munkin" <imun@tarantool.org>,
	"Mikhail Shishatskiy via Tarantool-patches"
Subject: Re: [Tarantool-patches]  [PATCH luajit v1] memprof: group allocations on traces by trace number
Date: Fri, 23 Jul 2021 10:54:49 +0300	[thread overview]
Message-ID: <1627026889.437497509@f405.i.mail.ru> (raw)
In-Reply-To: <YPgJUHIrwTi3ErJL@root>

[-- Attachment #1: Type: text/plain, Size: 1436 bytes --]

Hi! I have one more question:

How should we properly test the behavior of profiler recording allocations from traces?
Now I can write test which roughly estimates number of allocations in loop:
| local function payload()
|   -- Preallocate table to avoid table array part reallocations.
|   local _ = table_new(100, 0)
|   -- Want too see 100 objects here.
|   for i = 1, 100 do
|     -- Try to avoid crossing with "test" module objects.
|     _[i] = "memprof-str-"..i
|   end
|   _ = nil
|   -- VMSTATE == GC, reported as INTERNAL.
|   collectgarbage()
| end
  | jit.on() 
| symbols, events = `run_payload_under_memprof_and_parse`()
| alloc = `get_all_alloc_events`(symbols, events)
| test:ok(alloc[`line_where_loop_starts`].num > `some_guaranteed_number`)

But I think it will be great if we could replace > sign with ==. The problem is we cannot guarantee
constant number of allocations in the loop: on the most of platforms with `jit.opt.start(‘’hotloop=1’’, ‘’-sink’’)`
I get 97 allocations in 100-iteration loop, as we spend some iterations to compile the trace. But on freebsd,
for example, I get 24 allocations. ​​​​
Best regards,
Mikhail Shishatskiy
>Среда, 21 июля 2021, 14:48 +03:00 от Sergey Kaplun <skaplun@tarantool.org>:
>Hi! Thanks for the patch!
>Please consider my comments below.
>Best regards,
>Sergey Kaplun

[-- Attachment #2: Type: text/html, Size: 2262 bytes --]

  parent reply	other threads:[~2021-07-23  7:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-21  9:44 Mikhail Shishatskiy via Tarantool-patches
2021-07-21 11:47 ` Sergey Kaplun via Tarantool-patches
2021-07-21 11:52   ` Sergey Kaplun via Tarantool-patches
2021-07-23  7:54   ` Mikhail Shishatskiy via Tarantool-patches [this message]
2021-07-27  6:07     ` Sergey Kaplun via Tarantool-patches

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:

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

  git send-email \
    --in-reply-to=1627026889.437497509@f405.i.mail.ru \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=imun@tarantool.org \
    --cc=m.shishatskiy@tarantool.org \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches]  [PATCH luajit v1] memprof: group allocations on traces by trace number' \


* 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