How to keep "kill" in RAM?

Discussion in 'Mac Programming' started by nelly22, Aug 27, 2016.

  1. nelly22 macrumors 6502

    Joined:
    Sep 29, 2009
    #1
    Is there any way to keep unix "kill" running all the time so when my .sh script tells to kill some process, it's already in RAM-memory and runs little bit faster?
     
  2. Floris macrumors 68020

    Floris

    Joined:
    Sep 7, 2007
    Location:
    Netherlands
  3. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #3
    Please explain why you think this is a worthwhile way to gain speed. What shell are you running? How much extra speed do you need, or think you need?

    Unless you're running on a spinning hard disk, and it's spun down, the delay to run '/bin/kill' will be insignificant. If your script is looping, the first time it runs it'll be loaded into the disk cache. Thereafter, it will be present in cache and loaded from there.

    Furthermore, 'kill' is a bash builtin, so when you run it as 'kill' (as distinct from '/bin/kill') it's already "in RAM" and will already run as fast as it possibly can.

    To show that 'kill' is a bash builtin, type this command in a Terminal window:
    Code:
    type kill
     
  4. andy89 macrumors 6502

    Joined:
    May 22, 2005
    Location:
    Folkestone, England
    #4
    What chown33 said. And if you want to squeeze a little bit more out of your scripts I suggest you use ksh, which has a more complete set of builtins.
     

Share This Page