Tarantool development patches archive
 help / color / mirror / Atom feed
From: Sergey Ostanevich via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Sergey Kaplun <skaplun@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v2 luajit 2/5] test: adjust lua-Harness suite for LuaJIT
Date: Tue, 16 Mar 2021 17:25:16 +0300	[thread overview]
Message-ID: <864C77C4-C342-41FC-A7A0-0ACAF072F0C4@tarantool.org> (raw)
In-Reply-To: <20210315212710.GJ9042@tarantool.org>

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

Hi!

Thanks for the patch and review!


> On 16 Mar 2021, at 00:27, Igor Munkin <imun@tarantool.org> wrote:
> 
> Sergey,
> 
> On 15.03.21, Sergey Kaplun wrote:
>> Igor,
>> 
>> Thanks for the review!
>> 
>> On 15.03.21, Igor Munkin wrote:
>>> Sergey,
>>> 
>>> Thanks for the patch!
>>> 
>>> This is why it's so important to take the suite intact at first: I
>>> didn't even notice these changes in the previous series and now I regret
>>> a bit regarding the solution with LUAJIT_TEST_INIT: for this case it
>>> occurs to be ugly a little. Nevertheless, I believe Francois would be
>>> interested in this use case, so it's worth to file a bug against
>>> lua-Harness, IMHO.
>> 
>> I don't think so -- usage [1] declares the way to launch the suite.
>> It is our problem, that we don't use it.
> 
> OK, I'll do it myself then.
> 
>> 
> 
> <snipped>
> 
>>>> diff --git a/test/lua-Harness-tests/tap.lua b/test/lua-Harness-tests/tap.lua
>>>> index 08a99b8..5ce95e6 100644
>>>> --- a/test/lua-Harness-tests/tap.lua
>>>> +++ b/test/lua-Harness-tests/tap.lua
>>>> @@ -195,6 +195,15 @@ function todo (reason, count)
>>>>     todo_reason = reason
>>>> end
>>>> 
>>>> +-- The last arg element is guaranteed name of tested binary.
>>> 
>>> Typo: s/last/least/.
>>> Typo: s/guaranteed name of tested/guaranteed to be the name of the tested/.
>> 
>> Thanks, update the branch. See the iterative patch below.
>> ===================================================================
>> diff --git a/test/lua-Harness-tests/tap.lua b/test/lua-Harness-tests/tap.lua
>> index 5ce95e6..e527687 100644
>> --- a/test/lua-Harness-tests/tap.lua
>> +++ b/test/lua-Harness-tests/tap.lua
>> @@ -195,7 +195,8 @@ function todo (reason, count)
>>     todo_reason = reason
>> end
>> 
>> --- The last arg element is guaranteed name of tested binary.
>> +-- The least arg element is guaranteed to be the name
>> +-- of the tested binary.
>> function get_lua_binary_name ()
>>     local i = 0
>>     while arg[i] do
>> ===================================================================
>> 
>>> 
>>>> +function get_lua_binary_name ()
>>>> +    local i = 0
>>>> +    while arg[i] do
>>> 
>>> You make an excess lookup to a _G for each iteration. It's better to
>>> pass <arg> as an argument to this function. Furthermore, it makes the
>>> signature clearer, so user knows you're using <arg> to detect the
>>> interpreter name.
>> 
>> This economy looks unnecessary -- there are only 6 calls to this
>> function from the whole suite. You can provide time measurement
>> to prove me wrong.
>> I disagreed that it makes signature clearer, because there is no way to
>> use something instead `arg` variable anyway. Please, give me an
>> example, when usage of custom array is preferable than usage `arg`
>> variable. If this function *always* uses `arg` variable only, why we
>> should move it outside this function?
> 
> I forgot to add "feel free to ignore" here. You can write the code you
> like and I can't make you to do it another way alone. For this purpose
> there are two reviewers. I'll postpone my LGTM a bit for this change.
> 
> Regarding "no way to use something instead arg": nobody can stop you
> from parsing shebang.
> 

I believe the comment to the get_lua_binary_name tells exactly how the
binary is detected. Other than that - you will need to access the arg 
outside the function, hence if the code is not in a trace you’ll have
to pass it on the stack, and if it is in a trace the optimizer will
CSE the arg access from within the function?

LGTM.

Sergos


>> 
>>> 
>>>> +        i = i - 1
>>>> +    end
>>>> +    return arg[i + 1]
>>>> +end
>>>> +
>>>> --
>>>> -- Copyright (c) 2009-2018 Francois Perrad
>>>> --
>>>> -- 
>>>> 2.28.0
>>>> 
>>> 
>>> -- 
>>> Best regards,
>>> IM
>> 
>> [1]: https://fperrad.frama.io/lua-Harness/usage/
>> 
>> -- 
>> Best regards,
>> Sergey Kaplun
> 
> -- 
> Best regards,
> IM


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

  reply	other threads:[~2021-03-16 14:25 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-15 15:29 [Tarantool-patches] [PATCH v2 luajit 0/5] Adapt lua-Harness test suite Sergey Kaplun via Tarantool-patches
2021-03-15 15:29 ` [Tarantool-patches] [PATCH v2 luajit 1/5] test: add " Sergey Kaplun via Tarantool-patches
2021-03-15 17:37   ` Igor Munkin via Tarantool-patches
2021-03-15 18:10     ` Sergey Kaplun via Tarantool-patches
2021-03-15 21:06       ` Igor Munkin via Tarantool-patches
2021-03-16  9:38         ` Sergey Kaplun via Tarantool-patches
2021-03-16 11:08           ` Igor Munkin via Tarantool-patches
2021-03-16 12:02             ` Sergey Kaplun via Tarantool-patches
2021-03-16 13:50               ` Sergey Ostanevich via Tarantool-patches
2021-03-15 15:29 ` [Tarantool-patches] [PATCH v2 luajit 2/5] test: adjust lua-Harness suite for LuaJIT Sergey Kaplun via Tarantool-patches
2021-03-15 17:39   ` Igor Munkin via Tarantool-patches
2021-03-15 18:33     ` Sergey Kaplun via Tarantool-patches
2021-03-15 21:27       ` Igor Munkin via Tarantool-patches
2021-03-16 14:25         ` Sergey Ostanevich via Tarantool-patches [this message]
2021-03-15 15:29 ` [Tarantool-patches] [PATCH v2 luajit 3/5] test: adjust lua-Harness test suite for Tarantool Sergey Kaplun via Tarantool-patches
2021-03-15 17:44   ` Igor Munkin via Tarantool-patches
2021-03-16  6:01     ` Sergey Kaplun via Tarantool-patches
2021-03-16 10:51       ` Igor Munkin via Tarantool-patches
2021-03-16 14:51         ` Sergey Ostanevich via Tarantool-patches
2021-03-16 14:59         ` Sergey Kaplun via Tarantool-patches
2021-03-15 19:12   ` Igor Munkin via Tarantool-patches
2021-03-15 15:29 ` [Tarantool-patches] [PATCH v2 luajit 4/5] test: disable 241-standalone of lua-Harness suite Sergey Kaplun via Tarantool-patches
2021-03-16 14:51   ` Sergey Ostanevich via Tarantool-patches
2021-03-15 15:29 ` [Tarantool-patches] [PATCH v2 luajit 5/5] test: disable 411-luajit " Sergey Kaplun via Tarantool-patches
2021-03-16 14:52   ` Sergey Ostanevich via Tarantool-patches
2021-03-17  0:46 ` [Tarantool-patches] [PATCH v2 luajit 0/5] Adapt lua-Harness test suite Igor Munkin via Tarantool-patches
2021-03-17  7:32   ` Sergey Kaplun via Tarantool-patches
2021-03-17 10:27     ` Igor Munkin via Tarantool-patches
2021-03-17 10:31       ` Sergey Kaplun via Tarantool-patches
2021-03-17 16:49 ` Igor Munkin 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:
  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=864C77C4-C342-41FC-A7A0-0ACAF072F0C4@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=sergos@tarantool.org \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v2 luajit 2/5] test: adjust lua-Harness suite for LuaJIT' \
    /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