|
From: Francesc A. <fa...@py...> - 2011-01-31 11:41:52
|
A Saturday 29 January 2011 20:20:15 Raphael Weingartner escrigué:
[clip]
> Question:
> Why is openFile reading the original data file as an array.Array
> object if querying tables is so much faster?
The quick answer is that PyTables is specially tuned for, well, tables.
And these entities wear special I/O buffers and query engines that are
fined tuned for maximum speed. *Array objects do not wear the same
machinery.
By the way, you can get still faster queries by using the `where()`
method:
result = [x for x in h5fast.root.detector.where('pnum==7848107')]
For faster access, you can also use the indexation feature in PyTables
Pro. See:
http://www.pytables.org/docs/manual/ch05.html#searchOptim
for some benchmarks and advices on getting maximum query speed.
Hope this helps,
--
Francesc Alted
|