Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: Embperl

Performance problems while building tables

 

 

ModPerl embperl RSS feed   Index | Next | Previous | View Threaded


andreas.rieke at isl

Feb 23, 2007, 12:41 PM

Post #1 of 2 (1253 views)
Permalink
Performance problems while building tables

Hi,

using Embperl 2.2.0 with mod_perl 2.0.3 on a linux machine with perl
5.8.8, I have some performance problems with large tables. The code
which I have attached at the end of this message takes quite a long time
depending on the number of rows of the table. This is the time (in
seconds) embperl needs to process the code:
rows time
500 16
1000 63

With other words: When I have the double number of rows, I need the
double of the double time to process that. This behaviour has been
approved in several tests. As I sometimes have tables with 10000 and
more rows, I am not too lucky with that :-(
Am I doing something wrong? Can I do something to increase speed or do I
have to build the table with my own code in order to be faster?

Thanks in advance,

Andreas

This is the code:
[* $escmode=0; *]
[* $tabmode=18; $maxrow=10000; $maxcol=100;*]
<table border=0 bgcolor="fffffc" >
[* if ($row==0){ *]
<tr bgcolor="E0D8CD">
<th nowrap >[+ $head[$col] +]</th>
</tr>
<tr bgcolor="D9CFBF">
<th nowrap>[+ $subhead[$col] +]</th>
</tr>
[* } *]
[* if($bgcolor eq
"#EBE4DA"){$bgcolor="#DED6CB";}else{$bgcolor="#EBE4DA";} *]
<tr bgcolor=[+ $bgcolor +]>
<td nowrap [+ $td_attr[$col] +]>[+ $main_data[$row][$col] +]</td>
</tr>
</table>




---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe [at] perl
For additional commands, e-mail: embperl-help [at] perl


richter at ecos

Mar 20, 2007, 1:32 AM

Post #2 of 2 (1086 views)
Permalink
RE: Performance problems while building tables [In reply to]

Hi,

Sorry for the late reply.

>
> using Embperl 2.2.0 with mod_perl 2.0.3 on a linux machine
> with perl 5.8.8, I have some performance problems with large
> tables. The code which I have attached at the end of this
> message takes quite a long time depending on the number of
> rows of the table. This is the time (in
> seconds) embperl needs to process the code:
> rows time
> 500 16
> 1000 63
>
> With other words: When I have the double number of rows, I
> need the double of the double time to process that.

I can reproduce this here.

This is because Embperl has to compute several parts of the table, just
to see that the array has ended (value is undef) and throw it away.

I have changed your code to:

<table border=0 bgcolor="fffffc" >
<tr bgcolor="E0D8CD">
<td nowrap >[+ $head[$col] +]</td>
</tr>
<tr bgcolor="D9CFBF">
<td nowrap>[+ $subhead[$col] +]</td>
</tr>

[$foreach $data (@main_data) $]
[* if($bgcolor eq
"#EBE4DA"){$bgcolor="#DED6CB";}else{$bgcolor="#EBE4DA";} *]
<tr bgcolor=[+ $bgcolor +]>
[- $i = 0 -]
[$ foreach $cdata (@$data) $]
<td nowrap [+ $td_attr[$i++ ] +]>[+ $cdata +]</td>
[$endforeach$]
</tr>
[$endforeach$]
</table>

This has only a factor of 3 instead of 4 when doubling the number of
rows. This is also not perfect, but at least better than before.

The optimizations Embperl uses to speed things up reverses itself for
such huge tables :-(

Gerald



** Virus checked by BB-5000 Mailfilter **





---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe [at] perl
For additional commands, e-mail: embperl-help [at] perl

ModPerl embperl RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.