List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:January 12 2015 10:19pm
Subject:Re: Query much slower when using mysqlpp compared with mysql client
View as plain text  
On Jan 12, 2015, at 1:14 PM, gunnar <gharms@stripped> wrote:
> 
> 
> Most of the optimizations that you mention are micro-optimizations.

Are you including the change from value to reference semantics in that category?

Did you try changing from store() to storein()?  You’re creating an intermediate
std::vector between the DBMS and std::map here, unnecessarily.  (StoreQueryResult)

> Since we do a "select *”

That’s not what you showed in the first post.

Anyway, that sort of thing is why SSQLS in MySQL++ v3 uses Row::operator[](const char*)
instead of Row::operator[](int) as MySQL++ v2 did.  Programs compiled against v2 tended to
crash whenever the schema changed, until they were recompiled with compatible SSQLS
definitions.

> for (int i = 0; i < fieldNames->size(); ++i) {
>    fieldIndexes[(*fieldNames)[i]] = i;
> }

How many fields are we talking about here?

I think the reason that FieldNames is based on vector instead of map is that with a small
number of fields (say, under 10 or so) the overhead of the map might not pay off in terms
of lookup speed.

Still, I will consider doing this for the next version of MySQL++.
Thread
Query much slower when using mysqlpp compared with mysql clientgunnar7 Jan
  • Re: Query much slower when using mysqlpp compared with mysql clientWarren Young8 Jan
    • Re: Query much slower when using mysqlpp compared with mysql clientgunnar8 Jan
      • Re: Query much slower when using mysqlpp compared with mysql clientWarren Young12 Jan
        • Re: Query much slower when using mysqlpp compared with mysql clientgunnar12 Jan
          • Re: Query much slower when using mysqlpp compared with mysql clientWarren Young12 Jan
            • Re: Query much slower when using mysqlpp compared with mysql clientgunnar19 Jan