diff src/libpst.h @ 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 09dd5299d91c
children 3a1d25c579c6
line wrap: on
line diff
--- a/src/libpst.h	Wed Jul 06 10:20:12 2016 -0700
+++ b/src/libpst.h	Wed Jul 06 10:21:08 2016 -0700
@@ -105,7 +105,6 @@
     uint64_t offset;
     uint64_t size;
     int64_t  u1;
-    struct pst_index_ll *next;
 } pst_index_ll;
 
 
@@ -894,8 +893,9 @@
     char*   fname;
     /** default character set for items without one */
     const char*   charset;
-    /** the head and tail of the linked list of index structures */
-    pst_index_ll *i_head, *i_tail;
+    /** the array of index structures */
+    pst_index_ll *i_table;
+    size_t i_count, i_capacity;
     /** the head and tail of the top level of the descriptor tree */
     pst_desc_tree  *d_head, *d_tail;
     /** the head of the extended attributes linked list */