* [gentoo-user] Dash as /bin/sh? @ 2006-09-01 8:45 Alexander Skwar 2006-09-01 9:17 ` asl.pavel ` (2 more replies) 0 siblings, 3 replies; 14+ messages in thread From: Alexander Skwar @ 2006-09-01 8:45 UTC (permalink / raw To: gentoo-user Hi! The Ubuntu folks report on https://wiki.ubuntu.com/DashAsBinSh, that bootup and also ./configure runs are *WAY* faster if "dash" is used as /bin/sh instead of bash. Did anyone try this out on Gentoo? Are the boot scripts from Gentoo strictly POSIX compliant? Bye, Alexander Skwar -- Vini, vidi, Linux! -- Unknown source -- gentoo-user@gentoo.org mailing list ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [gentoo-user] Dash as /bin/sh? 2006-09-01 8:45 [gentoo-user] Dash as /bin/sh? Alexander Skwar @ 2006-09-01 9:17 ` asl.pavel 2006-09-01 10:13 ` Erik 2006-09-01 11:03 ` [gentoo-user] " Neil Bothwick 2 siblings, 0 replies; 14+ messages in thread From: asl.pavel @ 2006-09-01 9:17 UTC (permalink / raw To: gentoo-user But "/bin/sh" just link to "/bin/bash" On Fri, Sep 01, 2006 at 10:45:44AM +0200, Alexander Skwar wrote: > Hi! > > The Ubuntu folks report on https://wiki.ubuntu.com/DashAsBinSh, that > bootup and also ./configure runs are *WAY* faster if "dash" is used > as /bin/sh instead of bash. > > Did anyone try this out on Gentoo? Are the boot scripts from Gentoo > strictly POSIX compliant? > > Bye, > > Alexander Skwar > -- > Vini, vidi, Linux! > -- Unknown source > > > -- > gentoo-user@gentoo.org mailing list -- Aslanov Pavel 01.09.06 -- gentoo-user@gentoo.org mailing list ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [gentoo-user] Dash as /bin/sh? 2006-09-01 8:45 [gentoo-user] Dash as /bin/sh? Alexander Skwar 2006-09-01 9:17 ` asl.pavel @ 2006-09-01 10:13 ` Erik 2006-09-01 11:09 ` [gentoo-user] " Alexander Skwar 2006-09-01 11:03 ` [gentoo-user] " Neil Bothwick 2 siblings, 1 reply; 14+ messages in thread From: Erik @ 2006-09-01 10:13 UTC (permalink / raw To: gentoo-user Alexander Skwar wrote: > The Ubuntu folks report on https://wiki.ubuntu.com/DashAsBinSh, that > bootup and also ./configure runs are *WAY* faster if "dash" is used > as /bin/sh instead of bash. > > Did anyone try this out on Gentoo? Are the boot scripts from Gentoo > strictly POSIX compliant? I tried "time configure" in gnuplot several times for each shell and took the fastest time. shell real user sys bash 0m11.924s 0m6.848s 0m2.980s dash 0m11.822s 0m6.888s 0m2.816s static dash 0m11.977s 0m6.804s 0m3.064s dash would be 0,9% faster, which is not statistically significant when measuring like this. -- gentoo-user@gentoo.org mailing list ^ permalink raw reply [flat|nested] 14+ messages in thread
* [gentoo-user] Re: Dash as /bin/sh? 2006-09-01 10:13 ` Erik @ 2006-09-01 11:09 ` Alexander Skwar 0 siblings, 0 replies; 14+ messages in thread From: Alexander Skwar @ 2006-09-01 11:09 UTC (permalink / raw To: gentoo-user Erik <sigra@home.se>: > Alexander Skwar wrote: >> The Ubuntu folks report on https://wiki.ubuntu.com/DashAsBinSh, that >> bootup and also ./configure runs are *WAY* faster if "dash" is used >> as /bin/sh instead of bash. >> >> Did anyone try this out on Gentoo? Are the boot scripts from Gentoo >> strictly POSIX compliant? > > I tried "time configure" in gnuplot several times for each shell and > took the fastest time. > > shell real user sys > bash 0m11.924s 0m6.848s 0m2.980s > dash 0m11.822s 0m6.888s 0m2.816s > static dash 0m11.977s 0m6.804s 0m3.064s > > dash would be 0,9% faster, which is not statistically significant when > measuring like this. Interesting. Thanks. Them Ubuntu guys said, that the configure run for OOo is supposed to be much faster - 2 minutes, or so. Thanks! Alexander Skwar -- These PRESERVES should be FORCE-FED to PENTAGON OFFICIALS!! -- gentoo-user@gentoo.org mailing list ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [gentoo-user] Dash as /bin/sh? 2006-09-01 8:45 [gentoo-user] Dash as /bin/sh? Alexander Skwar 2006-09-01 9:17 ` asl.pavel 2006-09-01 10:13 ` Erik @ 2006-09-01 11:03 ` Neil Bothwick 2006-09-01 14:05 ` Neil Bothwick 2 siblings, 1 reply; 14+ messages in thread From: Neil Bothwick @ 2006-09-01 11:03 UTC (permalink / raw To: gentoo-user [-- Attachment #1: Type: text/plain, Size: 998 bytes --] On Fri, 01 Sep 2006 10:45:44 +0200, Alexander Skwar wrote: > The Ubuntu folks report on https://wiki.ubuntu.com/DashAsBinSh, that > bootup and also ./configure runs are *WAY* faster if "dash" is used > as /bin/sh instead of bash. I've just tried it on my 1GHz iBook and boot time dropped from 74s to 60s. That's timed from selecting a bootloader option to the root prompt appearing, less the time taken to type in my luks/dm-crypt passphrase. Most of the saving came in the early part of the boot process, the part before the password prompt (which comes from bootmisc AFAIK). It looked like the udev stuff happened quicker, but I can't quantify that. Anyway, a 20% reduction in boot time is nice, wherever it happens. Thanks for the pointer. > Did anyone try this out on Gentoo? Are the boot scripts from Gentoo > strictly POSIX compliant? I saw no errors, so they are certainly WFM compliant :) -- Neil Bothwick I'm Bugs Bunny of Borg. What's up Collective? [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [gentoo-user] Dash as /bin/sh? 2006-09-01 11:03 ` [gentoo-user] " Neil Bothwick @ 2006-09-01 14:05 ` Neil Bothwick 2006-09-01 14:33 ` [gentoo-user] " Harm Geerts 0 siblings, 1 reply; 14+ messages in thread From: Neil Bothwick @ 2006-09-01 14:05 UTC (permalink / raw To: gentoo-user [-- Attachment #1: Type: text/plain, Size: 510 bytes --] On Fri, 1 Sep 2006 12:03:35 +0100, Neil Bothwick wrote: > I saw no errors, so they are certainly WFM compliant :) Or not. The boot process worked fine, but some scripts started failing once the desktop was working. The first, somewhat appropriately, was sux. It works from a VC but errors out in an xterm with exec: 1: -l: not found I tried ash, only a few K larger than dash. This gave the same speed improvement and the same errors :( -- Neil Bothwick A good pun is its own reword. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 14+ messages in thread
* [gentoo-user] Re: Dash as /bin/sh? 2006-09-01 14:05 ` Neil Bothwick @ 2006-09-01 14:33 ` Harm Geerts 2006-09-01 15:21 ` Neil Bothwick 0 siblings, 1 reply; 14+ messages in thread From: Harm Geerts @ 2006-09-01 14:33 UTC (permalink / raw To: gentoo-user On Friday 01 September 2006 16:05, Neil Bothwick wrote: > On Fri, 1 Sep 2006 12:03:35 +0100, Neil Bothwick wrote: > > I saw no errors, so they are certainly WFM compliant :) > > Or not. The boot process worked fine, but some scripts started failing > once the desktop was working. The first, somewhat appropriately, was > sux. It works from a VC but errors out in an xterm with > > exec: 1: -l: not found > > I tried ash, only a few K larger than dash. This gave the same speed > improvement and the same errors :( You can force sux to use bash. Just replace the first line in /usr/bin/sux with "#!/bin/bash" You'd have to do the same for all scripts that depend on bash functionality. Speaking of which, you probably should see the shell used in the scripts from the sys-apps/baselayout package. All shell scripts use /bin/bash and not /bin/sh. So linking (d)ash as the default shell doesn't nearly have the impact you'd like it to have. -- gentoo-user@gentoo.org mailing list ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [gentoo-user] Re: Dash as /bin/sh? 2006-09-01 14:33 ` [gentoo-user] " Harm Geerts @ 2006-09-01 15:21 ` Neil Bothwick 2006-09-02 2:06 ` Harm Geerts 0 siblings, 1 reply; 14+ messages in thread From: Neil Bothwick @ 2006-09-01 15:21 UTC (permalink / raw To: gentoo-user [-- Attachment #1: Type: text/plain, Size: 848 bytes --] On Fri, 1 Sep 2006 16:33:01 +0200, Harm Geerts wrote: > You can force sux to use bash. > Just replace the first line in /usr/bin/sux with "#!/bin/bash" That was the first thing I tried, it made no difference. A quick look at sux shows it building a command to pas to exec that used $SHELL,. This is probably where it's switching back to /bin/sh, but I'm not prepared to spend much time looking for it to save 14 seconds. > Speaking of which, you probably should see the shell used in the > scripts from the sys-apps/baselayout package. All shell scripts > use /bin/bash and not /bin/sh. > > So linking (d)ash as the default shell doesn't nearly have the impact > you'd like it to have. A 20% reduction in boot time is a reasonable impact IMO. -- Neil Bothwick ... "I dropped my toothpaste," Tom said, Crestfallen. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 14+ messages in thread
* [gentoo-user] Re: Dash as /bin/sh? 2006-09-01 15:21 ` Neil Bothwick @ 2006-09-02 2:06 ` Harm Geerts 2006-09-02 2:57 ` Jerry McBride 2006-09-02 18:10 ` Neil Bothwick 0 siblings, 2 replies; 14+ messages in thread From: Harm Geerts @ 2006-09-02 2:06 UTC (permalink / raw To: gentoo-user On Friday 01 September 2006 17:21, Neil Bothwick wrote: > > Speaking of which, you probably should see the shell used in the > > scripts from the sys-apps/baselayout package. All shell scripts > > use /bin/bash and not /bin/sh. > > > > So linking (d)ash as the default shell doesn't nearly have the impact > > you'd like it to have. > > A 20% reduction in boot time is a reasonable impact IMO. Any chance that was a fluke? I've done a few reboots with bootchart to confirm this and I don't get any speedup. In fact /bin/sh is never called because the gentoo init scripts explicitly use bash. (sys-apps/baselayout-1.12.4-r7) -- gentoo-user@gentoo.org mailing list ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [gentoo-user] Re: Dash as /bin/sh? 2006-09-02 2:06 ` Harm Geerts @ 2006-09-02 2:57 ` Jerry McBride 2006-09-02 5:58 ` Richard Fish 2006-09-02 18:10 ` Neil Bothwick 1 sibling, 1 reply; 14+ messages in thread From: Jerry McBride @ 2006-09-02 2:57 UTC (permalink / raw To: gentoo-user On Friday 01 September 2006 22:06, Harm Geerts wrote: > On Friday 01 September 2006 17:21, Neil Bothwick wrote: > > > Speaking of which, you probably should see the shell used in the > > > scripts from the sys-apps/baselayout package. All shell scripts > > > use /bin/bash and not /bin/sh. > > > > > > So linking (d)ash as the default shell doesn't nearly have the impact > > > you'd like it to have. > > > > A 20% reduction in boot time is a reasonable impact IMO. > > Any chance that was a fluke? > > I've done a few reboots with bootchart to confirm this and I don't get any > speedup. In fact /bin/sh is never called because the gentoo init scripts > explicitly use bash. (sys-apps/baselayout-1.12.4-r7) I can't do it right now, I'm doing an "emerge -e world" on my laptop, but tomorrow I'll do a grep and sed and change #!/bin/bash to #!/bin/dash on the relavant parts of the baselayout and see if it has any impact, other than performance. "Slapping right hand to forehead...", This something I never thought of! Thanks for the idea. The other thing to consider is, you don't have to use "all" the gentoo init scripts... Just this week, I evaluated minit, initng, runit and fcache. For me, initNG offered the best overall improvement. However, I got even better performance with my own solution. Basicly, I use the very minimum number gentoo startup scripts. All I use are those that initialize the disks and that's it. The rest of the bootup process is done in local.start. My local.start configures all the devices on my laptop, including the lo, eth0 services. It loads the modules in correct order, brings up portmap, nfs, samba, cups, fam, hal, dbus, alsa, etc., etc. Where possible I run the commands as detached processes for even more performance... My local.start is ugly as hell, but very fast as there's very little bash/python scripting involved... and none of the python bloat that gentoo has going on in /etc/init.d. I'm able to get to a fully functioning command prompt in like 10 seconds after the kernel is done loading. Some configuration still goes on in the background, but I never notice it. I've got a lot more testing to do, but at first blush I believe the generation of this type of local.start could be automated. What I see happening is, once a gentoo user is satisfied that the box is setup to their liking, they'd run a script that would evaluate /etc/runlevels, scoop the necessary setup information from /etc/conf.d and generate a local.start providing the new boot process. The runlevels could be pruned automatically and on the next reboot, the new boot process is used for a dramatic decrease in boot time. I dunno, this could be fun. ;') Cheers all, Jerry -- gentoo-user@gentoo.org mailing list ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [gentoo-user] Re: Dash as /bin/sh? 2006-09-02 2:57 ` Jerry McBride @ 2006-09-02 5:58 ` Richard Fish 0 siblings, 0 replies; 14+ messages in thread From: Richard Fish @ 2006-09-02 5:58 UTC (permalink / raw To: gentoo-user On 9/1/06, Jerry McBride <mcbrides9@comcast.net> wrote: > little bash/python scripting involved... and none of the python bloat that > gentoo has going on in /etc/init.d. AFACT, python is never invoked for any of the init scripts. -Richard -- gentoo-user@gentoo.org mailing list ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [gentoo-user] Re: Dash as /bin/sh? 2006-09-02 2:06 ` Harm Geerts 2006-09-02 2:57 ` Jerry McBride @ 2006-09-02 18:10 ` Neil Bothwick 2006-09-02 18:38 ` Jerry McBride 1 sibling, 1 reply; 14+ messages in thread From: Neil Bothwick @ 2006-09-02 18:10 UTC (permalink / raw To: gentoo-user [-- Attachment #1: Type: text/plain, Size: 409 bytes --] On Sat, 2 Sep 2006 04:06:15 +0200, Harm Geerts wrote: > > A 20% reduction in boot time is a reasonable impact IMO. > > Any chance that was a fluke? I ran the test several times, and switched back top bash to confirm. The boot times were consistent, within the accuracy of the idiot holding the stopwatch :) -- Neil Bothwick If you got the words it does not mean you got the knowledge. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [gentoo-user] Re: Dash as /bin/sh? 2006-09-02 18:10 ` Neil Bothwick @ 2006-09-02 18:38 ` Jerry McBride 2006-09-03 11:49 ` [gentoo-user] " Alexander Skwar 0 siblings, 1 reply; 14+ messages in thread From: Jerry McBride @ 2006-09-02 18:38 UTC (permalink / raw To: gentoo-user On Saturday 02 September 2006 14:10, Neil Bothwick wrote: > On Sat, 2 Sep 2006 04:06:15 +0200, Harm Geerts wrote: > > > A 20% reduction in boot time is a reasonable impact IMO. > > > > Any chance that was a fluke? > > I ran the test several times, and switched back top bash to confirm. The > boot times were consistent, within the accuracy of the idiot holding the > stopwatch :) The only downside to this is that some emerges will fail if they rely on bash's enhanced features. I just did the roundy-round with this and ffmepg. Linking sh back to bash allowed the emerge to complete. The failure, by the way, was during configure. -- Jerry -- gentoo-user@gentoo.org mailing list ^ permalink raw reply [flat|nested] 14+ messages in thread
* [gentoo-user] Re: Re: Dash as /bin/sh? 2006-09-02 18:38 ` Jerry McBride @ 2006-09-03 11:49 ` Alexander Skwar 0 siblings, 0 replies; 14+ messages in thread From: Alexander Skwar @ 2006-09-03 11:49 UTC (permalink / raw To: gentoo-user · Jerry McBride <mcbrides9@comcast.net>: > On Saturday 02 September 2006 14:10, Neil Bothwick wrote: >> On Sat, 2 Sep 2006 04:06:15 +0200, Harm Geerts wrote: >> > > A 20% reduction in boot time is a reasonable impact IMO. >> > >> > Any chance that was a fluke? >> >> I ran the test several times, and switched back top bash to confirm. The >> boot times were consistent, within the accuracy of the idiot holding the >> stopwatch :) > > The only downside to this is that some emerges will fail if they rely on > bash's enhanced features. But those are broken ebuilds. If they need bash, then they've got to call bash and not sh, which has to be POSIX compliant and nothing more. > I just did the roundy-round with this and ffmepg. > Linking sh back to bash allowed the emerge to complete. The failure, by the > way, was during configure. With ffmpeg? > > Jerry Alexander Skwar -- Distrust all those who love you extremely upon a very slight acquaintance and without any visible reason. -- Lord Chesterfield -- gentoo-user@gentoo.org mailing list ^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2006-09-04 16:14 UTC | newest] Thread overview: 14+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2006-09-01 8:45 [gentoo-user] Dash as /bin/sh? Alexander Skwar 2006-09-01 9:17 ` asl.pavel 2006-09-01 10:13 ` Erik 2006-09-01 11:09 ` [gentoo-user] " Alexander Skwar 2006-09-01 11:03 ` [gentoo-user] " Neil Bothwick 2006-09-01 14:05 ` Neil Bothwick 2006-09-01 14:33 ` [gentoo-user] " Harm Geerts 2006-09-01 15:21 ` Neil Bothwick 2006-09-02 2:06 ` Harm Geerts 2006-09-02 2:57 ` Jerry McBride 2006-09-02 5:58 ` Richard Fish 2006-09-02 18:10 ` Neil Bothwick 2006-09-02 18:38 ` Jerry McBride 2006-09-03 11:49 ` [gentoo-user] " Alexander Skwar
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox