comparison python/python-libpst.cpp @ 360:26c48ea9d896

From Jeffrey Morlan: pst_build_id_ptr reads the Block BTree into a linked list, which pst_getID does a linear scan through. For large PSTs that have millions of blocks, this is extremely slow - almost all time is spent in pst_getID. Since the BTree entries must be in order, this can be dramatically improved by reading into an array and using binary search.
author Carl Byington <carl@five-ten-sg.com>
date Wed, 06 Jul 2016 10:21:08 -0700
parents 1ddc61fd6189
children 5c0ce43c7532
comparison
equal deleted inserted replaced
359:a3e674fade6c 360:26c48ea9d896
267 class_<pst_index_ll>("pst_index_ll") 267 class_<pst_index_ll>("pst_index_ll")
268 .def_readonly("i_id", &pst_index_ll::i_id) 268 .def_readonly("i_id", &pst_index_ll::i_id)
269 .def_readonly("offset", &pst_index_ll::offset) 269 .def_readonly("offset", &pst_index_ll::offset)
270 .def_readonly("size", &pst_index_ll::size) 270 .def_readonly("size", &pst_index_ll::size)
271 .def_readonly("u1", &pst_index_ll::u1) 271 .def_readonly("u1", &pst_index_ll::u1)
272 .add_property("next", make_getter(&pst_index_ll::next, return_value_policy<reference_existing_object>()))
273 ; 272 ;
274 273
275 class_<pst_id2_tree>("pst_id2_tree") 274 class_<pst_id2_tree>("pst_id2_tree")
276 .def_readonly("id2", &pst_id2_tree::id2) 275 .def_readonly("id2", &pst_id2_tree::id2)
277 .add_property("id", make_getter(&pst_id2_tree::id, return_value_policy<reference_existing_object>())) 276 .add_property("id", make_getter(&pst_id2_tree::id, return_value_policy<reference_existing_object>()))
584 ; 583 ;
585 584
586 class_<pst_file>("pst_file") 585 class_<pst_file>("pst_file")
587 .def_readonly("cwd", &pst_file::cwd) 586 .def_readonly("cwd", &pst_file::cwd)
588 .def_readonly("fname", &pst_file::fname) 587 .def_readonly("fname", &pst_file::fname)
589 .add_property("i_head", make_getter(&pst_file::i_head, return_value_policy<reference_existing_object>()))
590 .add_property("i_tail", make_getter(&pst_file::i_tail, return_value_policy<reference_existing_object>()))
591 .add_property("d_head", make_getter(&pst_file::d_head, return_value_policy<reference_existing_object>())) 588 .add_property("d_head", make_getter(&pst_file::d_head, return_value_policy<reference_existing_object>()))
592 .add_property("d_tail", make_getter(&pst_file::d_tail, return_value_policy<reference_existing_object>())) 589 .add_property("d_tail", make_getter(&pst_file::d_tail, return_value_policy<reference_existing_object>()))
593 .add_property("x_head", make_getter(&pst_file::x_head, return_value_policy<reference_existing_object>())) 590 .add_property("x_head", make_getter(&pst_file::x_head, return_value_policy<reference_existing_object>()))
594 .def_readonly("do_read64", &pst_file::do_read64) 591 .def_readonly("do_read64", &pst_file::do_read64)
595 .def_readonly("index1", &pst_file::index1) 592 .def_readonly("index1", &pst_file::index1)