List Info

Thread: Re: OO Design -- performance




Re: OO Design -- performance
user name
2007-02-27 22:48:44
On Dec 21, 2006, at 3:19 PM, David Balmain wrote:

> I'll be very interested to see if it there is a
noticable performance
> difference with the "final" classes.

I implemented final methods and final classes a little while
back.

All of the following classes became final, which means that
all of  
their methods became aliases for functions rather than
double- 
dereference invocations via vtable:

    DelDocs
    PostingsWriter
    SegInfo
    TermInfo
    TermInfosWriter
    TermVectorsReader
    TermVectorsWriter
    InStream
    OutStream
    SortExternal

Truncated mean time to index 1000 Reuters news stories:

    Before: 1.83 seconds
    After:  1.82 seconds

Glad it didn't take me very long to implement.  

It's worth noting, though, that a lot of the VInt-writing
was already  
handled via function calls.

Marvin Humphrey
Rectangular Research
http://www.rectangular.co
m/

slothbear:~/projects/ks/perl/t/benchmarks marvin$ perl
-Mblib  
indexers/kinosearch_indexer.plx --docs=1000 --reps=30
------------------------------------------------------------

1    Secs: 1.82  Docs: 1000
2    Secs: 1.83  Docs: 1000
3    Secs: 1.83  Docs: 1000
4    Secs: 1.84  Docs: 1000
5    Secs: 1.86  Docs: 1000
6    Secs: 1.81  Docs: 1000
7    Secs: 1.83  Docs: 1000
8    Secs: 1.83  Docs: 1000
9    Secs: 1.85  Docs: 1000
10   Secs: 1.82  Docs: 1000
11   Secs: 1.81  Docs: 1000
12   Secs: 1.80  Docs: 1000
13   Secs: 1.81  Docs: 1000
14   Secs: 1.82  Docs: 1000
15   Secs: 1.82  Docs: 1000
16   Secs: 1.82  Docs: 1000
17   Secs: 1.82  Docs: 1000
18   Secs: 2.23  Docs: 1000
19   Secs: 1.85  Docs: 1000
20   Secs: 1.86  Docs: 1000
21   Secs: 1.82  Docs: 1000
22   Secs: 1.84  Docs: 1000
23   Secs: 1.82  Docs: 1000
24   Secs: 1.85  Docs: 1000
25   Secs: 1.81  Docs: 1000
26   Secs: 1.84  Docs: 1000
27   Secs: 2.36  Docs: 1000
28   Secs: 1.87  Docs: 1000
29   Secs: 1.83  Docs: 1000
30   Secs: 1.81  Docs: 1000
------------------------------------------------------------

KinoSearch 0.20_01
Perl 5.8.6
Thread support: yes
Darwin 8.8.0 Power Macintosh
Mean: 1.86 secs
Truncated mean (16 kept, 14 discarded): 1.83 secs
------------------------------------------------------------

slothbear:~/projects/ks/perl/t/benchmarks marvin$


slothbear:~/projects/ks/perl/t/benchmarks marvin$ perl
-Mblib  
indexers/kinosearch_indexer.plx --docs=1000 --reps=30
------------------------------------------------------------

1    Secs: 1.89  Docs: 1000
2    Secs: 1.83  Docs: 1000
3    Secs: 1.83  Docs: 1000
4    Secs: 1.83  Docs: 1000
5    Secs: 1.81  Docs: 1000
6    Secs: 2.26  Docs: 1000
7    Secs: 2.00  Docs: 1000
8    Secs: 1.80  Docs: 1000
9    Secs: 1.83  Docs: 1000
10   Secs: 1.82  Docs: 1000
11   Secs: 1.80  Docs: 1000
12   Secs: 1.81  Docs: 1000
13   Secs: 1.92  Docs: 1000
14   Secs: 1.81  Docs: 1000
15   Secs: 2.32  Docs: 1000
16   Secs: 1.83  Docs: 1000
17   Secs: 1.81  Docs: 1000
18   Secs: 1.81  Docs: 1000
19   Secs: 1.79  Docs: 1000
20   Secs: 1.81  Docs: 1000
21   Secs: 1.79  Docs: 1000
22   Secs: 1.88  Docs: 1000
23   Secs: 1.82  Docs: 1000
24   Secs: 2.31  Docs: 1000
25   Secs: 1.83  Docs: 1000
26   Secs: 1.84  Docs: 1000
27   Secs: 1.83  Docs: 1000
28   Secs: 1.83  Docs: 1000
29   Secs: 1.83  Docs: 1000
30   Secs: 1.81  Docs: 1000
------------------------------------------------------------

KinoSearch 0.20_01
Perl 5.8.6
Thread support: yes
Darwin 8.8.0 Power Macintosh
Mean: 1.88 secs
Truncated mean (16 kept, 14 discarded): 1.82 secs
------------------------------------------------------------

slothbear:~/projects/ks/perl/t/benchmarks marvin$



Re: OO Design -- performance
user name
2007-02-28 00:43:20
On 2/28/07, Marvin Humphrey <marvinrectangular.com> wrote:
>
> On Dec 21, 2006, at 3:19 PM, David Balmain wrote:
>
> > I'll be very interested to see if it there is a
noticable performance
> > difference with the "final" classes.
>
> I implemented final methods and final classes a little
while back.
>
> All of the following classes became final, which means
that all of
> their methods became aliases for functions rather than
double-
> dereference invocations via vtable:
>
>     DelDocs
>     PostingsWriter
>     SegInfo
>     TermInfo
>     TermInfosWriter
>     TermVectorsReader
>     TermVectorsWriter
>     InStream
>     OutStream
>     SortExternal
>
> Truncated mean time to index 1000 Reuters news
stories:
>
>     Before: 1.83 seconds
>     After:  1.82 seconds
>
> Glad it didn't take me very long to implement.  

Thanks for posting this. It'll probably save me a lot of
time (or
worry) in the future. 

-- 
Dave Balmain
http://www.davebalmain.co
m/

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )