tech-pkg archive

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

Optimising check-interpreter



This one is probably more controversial, but the gains are so large
that it's worth raising for discussion.

I'd like to change mk/check/check-interpreter.mk so that it only
checks executable files.  The rationale being that I can't think of
any cases where we'd care what the shebang of a non-executable file
is, and if a file is erroneously non-executable when it should be
executable, then that should be fixed prior to the check being run.

The diff is simple:

  http://us-east.manta.joyent.com/pkgsrc/public/patches/check-interp.diff

and the performance difference for lang/ruby193-base is before:

  $ ptime bmake _check-interpreter
  => Checking for non-existent script interpreters in ruby193-base-1.9.3p547

  real     1:36.154904091
  user       17.554778405
  sys      1:10.566866515

and after:

  $ ptime bmake _check-interpreter
  => Checking for non-existent script interpreters in ruby193-base-1.9.3p547

  real        2.658741177
  user        1.339411743
  sys         1.236949825

due to reducing the number of sed(1) calls required down from 13,000+
to just 108.

If there are legitimate reasons for wanting to check non-existent
files, how about making it a variable so it can be easily turned on or
off?

Thanks,

-- 
Jonathan Perkin  -  Joyent, Inc.  -  www.joyent.com


Home | Main Index | Thread Index | Old Index