On 2 Jun 2011, at 8:55am, Dominique Pellé wrote: > Roger Binns wrote: > >> While those are all valid, they don't address the underlying issue which is >> C code taking five times longer than Python code for the same SQLite >> operations. In addition that same "redundant" code is executed behind the >> scenes in Python so it is fair for these comparisons/benchmark. >> >> Other things having been ruled out, it looks like Jan's suggestion of >> compilation options and code is likely the cause.
One does normally assume that C code is going to be pretty efficient. I was surprised at the OP's information. > That's true of course and I should have mentioned it. > However, for a benchmark, it's best to avoid things that > can be trivially optimized. I don't know how the python > code translates into SQLite C API. Python is a bytecode language. Current compilers (the bit that /makes/ the bytecodes, not the bit that reads them) are very good at trimming off code which leads to results which are never used. Which, as commented above, makes it extremely difficult to write benchmark programs in Python. Simon. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users