LWN.net Logo

OLS: On how user space sucks

OLS: On how user space sucks

Posted Jul 24, 2006 23:27 UTC (Mon) by cjwatson (subscriber, #7322)
In reply to: OLS: On how user space sucks by ekj
Parent article: OLS: On how user space sucks

On Ubuntu, pcmciautils is installed by default because - aside from its init script - it's pretty small and lightweight (compared to the monster that was pcmcia-cs/cardmgr) and it simplifies the installer, debugging the resulting system, etc. if we just install it all the time.

Per Olofsson simplified that init script a fair bit in Debian; Edgy has that simplification, and e.g. no longer calls laptop-detect.

It's also worth noting that 'case' in shell scripts doesn't spawn a subprocess, unlike 'if [ ... ]', so simply counting conditionals doesn't always give you a fair picture.


(Log in to post comments)

Test, with "test" vs /usr/bin/test

Posted Jul 25, 2006 3:59 UTC (Tue) by Richard_J_Neill (subscriber, #23093) [Link]

"if [ a = b ] " and "if test a = b " are both shell-builtins. If you want the other one, you have to call /usr/bin/test

$ date; for ((i=0; i<10000; i++)) ; do if [ a = b ] ; then c=d ; fi ; done ;date
Tue Jul 25 04:51:16 BST 2006
Tue Jul 25 04:51:16 BST 2006

$ date; for ((i=0; i<10000; i++)) ; do if test a = b ; then c=d ; fi ; done ;date
Tue Jul 25 04:51:27 BST 2006
Tue Jul 25 04:51:27 BST 2006

$ date; for ((i=0; i<10000; i++)) ; do if /usr/bin/test a = b ; then c=d ; fi ; done ;date
Tue Jul 25 04:51:33 BST 2006
Tue Jul 25 04:51:50 BST 2006

It's a huge difference! The script with the builtins runs 60 times faster.

Test, with "test" vs /usr/bin/test

Posted Jul 29, 2006 15:43 UTC (Sat) by kreutzm (subscriber, #4700) [Link]

Where do you see that "60x"? ALso I'd advise you to use time(1) next time ;-)

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