Am Mittwoch, 29. Januar 2003 11:22 schrieb Nicholas Clark:
...
>
> Loading POSIX itself is slow *by default*
>
> $ time perl -e 'use POSIX'
>
> real  0m0.060s
> user  0m0.060s
> sys   0m0.000s
>
> One speed (and slight size reduction) trick is to use an explicit import
> list
>
> $ time perl -e 'use POSIX qw(log10)'
>
> real  0m0.043s
> user  0m0.020s
> sys   0m0.020s
>
> Nicholas Clark

If you have problems with 20ms you shouldn't use perl.

It is not worth creating a perl-module for such simple cases.

By the way - here is my version. Just store it in some 
$PERL5LIB/Math/Log10.pm:

sub log10
{
  return log(shift)/log(10);
}

1;

Then you can do perl -e 'use Math::Log10; print log10(43.2);', which is 3 
times faster than perl -e 'use POSIX qw(log10); print log10(43.2);'.

Do you really want to make a module out of it?


Tommi M�kitalo

Reply via email to