List:MySQL++« Previous MessageNext Message »
From:Chris Morgan Date:May 5 2009 12:38am
Subject:Why Does SSQLS populate_* Function use Inefficient operator[]?
View as plain text  
Hi -

I've been benchmarking our software for the last few weeks looking for
bottlenecks, and one of the things that we noticed was that the SSQLS
constructor (given a mysqlpp::Row) was taking a disproportionate amount of
time compared to similar assignment operations.  I changed our code to set
the values in the SSQLS one by one using the column index enums instead of
column name strings, and I got a 2x speed improvement overall (working in a
loop with ~40000 iterations, it saved almost 1 second).

Why does the ssqls.pl script use the inefficient operator [] (const char*
field) instead of operator [] (int i)?  The Reference Manual (
http://tangentsoft.org/mysql++/doc/html/refman/classmysqlpp_1_1Row.html#a23)
specifically warns not to do that.  I glanced through ssqls.pl and couldn't
come up with a quick patch, but I'm sure if I had some more time I could fix
it.  I'm using 3.0.9.

Thanks for any insight you might have.

-Chris

Thread
Why Does SSQLS populate_* Function use Inefficient operator[]?Chris Morgan5 May
  • Re: Why Does SSQLS populate_* Function use Inefficient operator[]?Warren Young5 May
    • Re: Why Does SSQLS populate_* Function use Inefficient operator[]?Warren Young5 May
      • Re: Why Does SSQLS populate_* Function use Inefficient operator[]?Chris Morgan5 May
        • Re: Why Does SSQLS populate_* Function use Inefficient operator[]?Warren Young5 May
          • Re: Why Does SSQLS populate_* Function use Inefficient operator[]?Chris Morgan5 May