On Fri, May 23, 2008 at 08:20:50PM -0400, Hugo Villeneuve wrote:
> perl offers faster software development. perl is not fast. Just
> saying. Althought, I think that's what you meant too.
> 
> # sysctl  hw.model hw.physmem
> hw.model=SUNW,SPARCclassic, TMS390S10 @ 50 MHz, on-chip FPU
> hw.physmem=24801280
> 
> # time pkg_info
> gettext-0.16.1      GNU gettext
> libiconv-1.9.2p5    character set conversion library
> lrzsz-0.12.20p0     receive/send files via X/Y/ZMODEM protocol
> mutt-1.4.2.3        tty-based e-mail client
> stunnel-4.20        SSL encryption wrapper for standard network daemons
> uucp-1.07p2         UUCP suite
>     0m22.57s real     0m13.05s user     0m6.44s system
> 
> 22 seconds to list one folder and open 6 files :)
> 
> I doubt it took 1 seconds before the move to perl on that computer.

You're partly confusing start-up time and speed.

In less trivial tasks than pkg_info, for instance actual use of pkg_add, the
new tools are faster.

Most run-times are dominated by IO. The old tools were using external tar(1)
to a temporary area, then copying over to the final destination. That makes
for double IO, and thus very slow.

Replacing that in the old tools would not have been feasible.

Likewise, the new tools do not spend all their time re-discovering the
world. If you pkg_add *.tgz, you run one instance of pkg_add which keeps
every info it needs in memory  (and I spent some time specifically improving
that so that, even with all the checks being done, pkg_add can handle
1000s of packages before overflowing 64M).

pkg_info time was similarly improved when we finally merged +COMMENT into
+CONTENT, so that less files got opened and read.

pkg_info on an installation with few packages installed is the odd case where
it is noticeably slower.

Seriously, the advantages far outweigh the problem. It's been my experience
that a language such as perl allows you to deploy much faster algorithms
in the same amount of time it will take to code the same problem in C.
The rapid application development facilities by themselves are tremendous.
It's ways simpler to tune things so that they run circle around their
C counterparts. Happened with pkg_add, happened with makewhatis. And I ran
the benches to check it.

Of course you won't be able to run old pkg_* with our new pkg tools, the
new ones do so much more. But on sheer pkg extraction, the new tools win
by a factor or 2.

Reply via email to