[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] Interchange using lots of cpu...
gordon@nextrieve.com wrote:
> >
> > It sounds like something somewhere is copying either the result set or
> > something associated with it with some nasty quadratic behavior. It
> > wouldn't be Safe.pm would it? Or some other consequence of firing
> > up perl? I feel that this is the most likely explanation at this point.
> >
> In fact, when using [benchmark] on nearly every line, it seems that the
> problem is not related to 'firing up perl'. A single occurrence of
> [ARTICLE-param col10]
> for example can take 0.07 seconds during initial loop iterations on 'large'
> result sets. A bit surprising. If you want to dump out the content of 10
> fields like that, voila, 0.7 seconds PER ROW, gradually speeding up as
> results are emitted. The last couple of hundred rows fly by, so unless
> you process more than that you won't notice the problem.
>
I suggest that you set up a simple loop that runs your SQL query and show
[loop-code] for each result. Benchmark that and then start to add the
rest of your code, a bit at a time. It won't take long to find the
problem.
>
> As that seemed so fundamental I gave up on that approach and just dumped
> the [query] results out in a single [perl] tag -- it now runs 100x faster
> at least.
>
That's what I tend to do for complex loops.
--
_/ _/ _/_/_/_/ _/ _/ _/_/_/ _/ _/
_/_/_/ _/_/ _/ _/ _/ _/_/ _/ K e v i n W a l s h
_/ _/ _/ _/ _/ _/ _/ _/_/ kevin@cursor.biz
_/ _/ _/_/_/_/ _/ _/_/_/ _/ _/