![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello, I've been using mysql++ for some time, and I've run into a very annoying performance issue. This email contains an example demonstrating the problems (and Makefile for build and python script to create the db). |
|
I hope any of you can help me, |
#3
| |||
| |||
|
|
I think the problem may be caused by the const_subscript_container as a base for Result, |
#4
| |||
| |||
|
|
Erwin wrote: I think the problem may be caused by the const_subscript_container as a base for Result, Chris nailed it: you should be using Query::use(), and therefore ResUse instead. Instead of trying to store all the records in memory, a "use" query grabs the records from the server one at a time, and you process them linearly. It's like the difference between a random access iterator into a vector and an input iterator into an I/O stream. I'm working on the documentation now, and will add a section to make this clearer. P.S. Documentation team, yer Fired! ...until I finish hacking on the docs anyway. Don't want to have duplicate effort... |
#5
| |||
| |||
|
|
I think the problem may be caused by the const_subscript_container as a base for Result, Chris nailed it: you should be using Query::use(), and therefore ResUse instead. Instead of trying to store all the records in memory, a "use" query grabs the records from the server one at a time, and you process them linearly. It's like the difference between a random access iterator into a vector and an input iterator into an I/O stream. |
|
I'm working on the documentation now, and will add a section to make this clearer. |
#6
| |||
| |||
|
|
I used the Result because it has the nice iterator, which ResUse does not have. |
|
So, I'm writing one in stead, |
|
I'm working on the documentation now, and will add a section to make this clearer. |
#7
| ||||
| ||||
|
|
I used the Result because it has the nice iterator, which ResUse does not have. I'm not sure what you're saying. Did you do this: Result r = q.use(...) ? If so, that't not legitimate. You can't force a 'use' query result to be random-access. |
|
So, I'm writing one in stead, "One" what? Do you mean you're adding an iterator to ResUse? If so, be |
|
of the question. Be sure it doesn't conflict with Result's iterator, too, since it subclasses from ResUse. |
|
Here's a direct link: |
#8
| |||
| |||
|
|
as this is a random-access iterator, it apparently slows down for each row used (funnily enough, without increasing memory use, and O(n^2), instead of O(n) which I would expect). |
![]() |
| Thread Tools | |
| Display Modes | |
| |