On 1/31/06, John Siracusa <[EMAIL PROTECTED]> wrote: > CDBI will go back to the database to fetch those values. To change > this, make all of the columns "essential" in your CDBI class: > > __PACKAGE__->columns(Essential => qw(id nome estado));
Yes, I think I forgot about this because there's a long time since I hand-programmed CDBI classes. I guess I got kind of used to using CDBI::Loader. > Alternately, you could make all of the columns "lazy" in your RDBO > class. Then it will mimic the CDBI behavior. The point is to do an > apples-to-apples comparison. Another option is to try to make each > module go as fast as possible. Your benchmark as it existed did > neither. Actually, I think my benchmarks served one purpose after all: to compare the modules using the naive approach. But as a "true" performance indicator it really was flawed. > To sum up, it's important decide what it is you really want to test. > Making good benchmarks is hard. I did my best to isolate the > performance of several common tasks in the benchmark suite that is > bundled with Rose::DB::Object. (The script is located at: > t/benchmarks/bench.pl) I tried to make each module go as fast as > possible while accomplishing the same task, since that's what people > will do in the real world. What I wanted to test was a simple general case. I really didn't mean to test isolated aspects or anything like that. > If you want to pursue your own benchmarks, consider the changes I > recommended above. But also please take a long look at the source > code and classes for the bench.pl script before you decide that you > need to test something that isn't represented there. I initially planned to use the benchmark suite that comes with RDBO, but I didn't have the stomach to go through the 120kb of code to try to figure out how it worked. ;-) Anyway, I re-run the tests with the changes you mentioned and, unfortunately, only CDBI performance improved. Now CDBI is slightly faster than RDBO, even with RDBO prefetching the objects and CDBI doing no prefetching. The changes are exactly what you suggested. The benchmark results: RDB 43.3/s -- -0% -78% CDBI 43.4/s 0% -- -78% ObjRelMap 198/s 357% 356% -- ObjRelMap represents the in-house ORM implementation I mentioned. Of course that as a whole it's less sofisticated than any of the current standard solutions (CDBI, Sweet, DBIC or RDBO) but it has built-in auto-joins with multi-level prefetching (which could be further improved since currently several queries might be dispatched), caching and can handle low-to-medium complexity queries which are enough for my current purposes. I think that when I've got the time I'll try to run these benchmarks under the profiler so I can better understand what exactly is causing RDBO to be slowed down. But thanks for your lengthy reply. I was sure that the performance could be improved and it really almost doubled for RDBO after your suggested changes. -Nilson Santos F. Jr. ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642 _______________________________________________ Rose-db-object mailing list Rose-db-object@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rose-db-object