|
|
Log in / Subscribe / Register

Handling argc==0 in the kernel

Handling argc==0 in the kernel

Posted Jan 31, 2022 9:55 UTC (Mon) by NYKevin (subscriber, #129325)
In reply to: Handling argc==0 in the kernel by anselm
Parent article: Handling argc==0 in the kernel

I would bet that there was somebody who insisted that one or the other of those loops was 2% faster on architecture X (for some value of X), and therefore demanded that it be allowed.

I would tend to assume that the int loop is marginally easier to branch-predict? But I'm somewhat skeptical that that was relevant on the hardware of the time...


to post comments

Handling argc==0 in the kernel

Posted Jan 31, 2022 11:19 UTC (Mon) by mfuzzey (subscriber, #57966) [Link]

Especially as the time spent processing the argument list is likely to be negligable compared with the time doing the exec() and all the subsequent setup of the new process (loading shared libraries etc). The strace output for hello world is quite "frightening"...


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds