Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


On Fri, Aug 12, 2011 at 11:14 PM, Jordan Ayers <jordan.ayers@gmail.com> wrote:
A few more patches to clean up parts of the solenv perl scripts.

The first is just removing pieces that became useless after prior
patches, or that were added as part of a larger patch, even though
they were never used.  (I'm basing this on the master branch git log
entries.)

Applied and pushed, thanks.


The second has a minor impact on build.pl calling behavior, but seems
reasonable.  The --dontgraboutput switch hasn't done anything for some
time, except cause build.pl to abort if this switch was specified
before the --html switch.  If specified now, it will pass through to
the dmake options (where it shouldn't do anything); it can no longer
prevent build.pl from running.

Applied and push, thanks.


The last just shortens the debuginfo / debugsave calls; since every
time these were used, they were wrapped in checks against the debug
flag, I pushed the debug flag check into those routines.  Now they can
just be called, and if debugging is off they do nothing.

Actually this 'shorten' their appearance, but lengthen their execution.
Indeed before the cost of call to debuginfo/debugsave in non debug case, was

if(variable = true)

with this patch it is:

Evaluate the argument of the call, make the function call,
if(variable=true) return to the caller

This can be very bad (see example below), and can never be faster.

So I have not pushed this one.

Norbert

-----

example:

#! /usr/bin/perl -w

use strict;

my $mode = $ARGV[0];
my $debug = $ARGV[2];

my %foo =();

$foo{'s'} = "bar";
$foo{'f'} = "foo";

if(!defined($debug))
{
    $debug = 0;
}

sub sdebug
{
    my ($message) = @_;
    if($debug)
    {
        print $message;
    }
}
sub fdebug
{
    my ($message) = @_;
};

if($mode eq "f")
{
    for(my $i = 0; $i < 100000; $i++)
    {
        if($debug)
        {
            fdebug("message $i $foo{$mode} $#ARGV\n");
        }
    }
}
else
{
    for(my $i = 0; $i < 100000; $i++)
    {
        sdebug("message $i $foo{$mode} $#ARGV\n");
    }
}


n_th@tpamac ~/bin $time tperfperl.pl s

real    0m0.180s
user    0m0.173s
sys     0m0.006s
n_th@tpamac ~/bin $time tperfperl.pl s

real    0m0.178s
user    0m0.171s
sys     0m0.006s
n_th@tpamac ~/bin $time tperfperl.pl s

real    0m0.177s
user    0m0.171s
sys     0m0.006s
n_th@tpamac ~/bin $time tperfperl.pl f

real    0m0.017s
user    0m0.010s
sys     0m0.006s
n_th@tpamac ~/bin $time tperfperl.pl f

real    0m0.018s
user    0m0.010s
sys     0m0.006s
n_th@tpamac ~/bin $time tperfperl.pl f

real    0m0.017s
user    0m0.010s
sys     0m0.006s

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.