Re: [PATCH 3/3] lib: vsprintf: added a put_dec() test and benchmark tool

From: Raja R Harinath
Date: Fri Aug 06 2010 - 11:58:15 EST


Hi,

MichaÅ Nazarewicz <m.nazarewicz@xxxxxxxxxxx> writes:

> On Fri, 06 Aug 2010 07:10:06 +0200, Denys Vlasenko <vda.linux@xxxxxxxxxxxxxx> wrote:
>
>> On Friday 06 August 2010 00:38, Michal Nazarewicz wrote:
>>> This commit adds a test application for the put_dec() and
>>> family of functions that are used by the previous two commits.
>>>
>>> Signed-off-by: Michal Nazarewicz <mina86@xxxxxxxxxx>
>>
>>> +put-dec-test: put-dec-test.c
>>> + exec $(CC) $(CFLAGS) -o $@ $<
>>
>> (1) Why exec?
>
> Micro Makefile optimisation -- saves us a fork().

I don't think it's worth it. The use of 'exec' will force make to
invoke the shell, while without the exec, make has an opportunity to
optimize out the shell invocation completely [1]. Forcing the use of a
shell to avoid a fork() sounds like a terrible trade-off.

- Hari

[1] See, for instance, construct_command_argv_internal() in

http://cvs.savannah.gnu.org/viewvc/make/job.c?root=make&view=markup

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/