[elephant-devel] optimized map-index?
Alex Mizrahi
killerstorm at newmail.ru
Mon Jan 7 13:37:55 UTC 2008
helo
i've implemented optimized map-index specialization to get better
performance for get-instances-by-value.
but for now "better cursors" i've implemented later and Ian's optimized
map-index implementations should do pretty well too.
numerically i have following stats for doing 100 get-instances-by-value
queries on 10000 elements table:
normal map-index:
0.284 seconds of real time
0.032002 seconds of user run time
0.136009 seconds of system run time
0 calls to %EVAL
0 page faults and
3,289,600 bytes consed.
specialized map-index:
Evaluation took:
0.221 seconds of real time
0.004001 seconds of user run time
0.096006 seconds of system run time
0 calls to %EVAL
0 page faults and
1,555,536 bytes consed.
it appears walking by cursors introduce some overhead (twice more consing),
but it's not that significant comparing to overall communication overhead.
on PostgreSQL side, queries made by cursor are more complex, but again
difference is not significant: something like 0.03 msecs for direct and 0.04
for cursor ones.
so, i'm not sure if i should delete specialized map-index version.
benefits of pure cursor version:
* no additional code to maintain, less complexity
* works in iterative way: if we have *lots* of instances with specific
value, cursor version will allow to iterate through them one at time (well,
10 at time), and it's possible to abort iteration. (other version will try
to fit everything in memory or will fail)
benefits of optimized version:
* works somewhat faster
* uses straightforward SQL query
thinking........
seems "pure" version benefits outweight optimized one, so i'm deleting
specialization..
More information about the elephant-devel
mailing list