Hello,

Looking at the code (at least the mysql version), I see a huge
optimization opportunity for db_get_result. 

Currently it does a new seek and retriveve for every call. It could
cache the row number in a static variable, and if called again for the
same row, just use the current value of last_row (which is already
static anyway). Of course it would need to check whether the result set
was changed since last time, too.

The only problem is, this approach is not thread-safe. Well, currently
the code does not seem thread-safe anyway with a static last_row - but
I'd better be safe than sorry.

So: does it need to be thread-safe?

If not, I'll do the change, test it, and provide the patch. So thes
econd version: should I make a patch against 2.0, or pull CVS and  patch
against (and test with) that version?

Yours, Mikhail Ramendik


Reply via email to