help-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [coreutils] slimmer alternative to sleep command?


From: Paul Jarc
Subject: Re: [coreutils] slimmer alternative to sleep command?
Date: Sun, 25 Jan 2009 00:54:48 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Chris Jones <cjns1989@gmail.com> wrote:
> I would imagine the linux implementation of the sleep() function does
> not result in anything besides some system call or other?

Right.  But any time you're worried about performance (or more
generally, any sort of resource overuse), keep in mind these two
cardinal rules:
- The best opportunity for improvement is the part of the program that
  consumes the most time/memory/etc.
- Finding the most expensive part of the program cannot be done
  reliably by reading/thinking about the program, even for very
  experienced programmers.  Measurement is the only reliable way.

Attempts to improve a program's resource usage often make the program
harder to understand and maintain, so it's good to first make sure
that the change you're making will have a significant impact on the
overall system.

"Premature optimization is the root of all evil." - Donald Knuth
"Profile, don't speculate." - Danial Bernstein


paul




reply via email to

[Prev in Thread] Current Thread [Next in Thread]