/ Check-in [5d20ff9e]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Performance optimization on nodeGetCell() in R-Tree.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | rtree-enhancements
Files: files | file ages | folders
SHA1:5d20ff9ec837ad35bc44d6c25d13764b350e81dd
User & Date: drh 2014-04-16 21:02:28
Context
2014-04-17
13:15
Refactor the constraint checking logic in RTree. The new-style constraint callbacks created by sqlite3_rtree_query_callback() are now hooked up from end to end, though still untested. check-in: 32a13870 user: drh tags: rtree-enhancements
2014-04-16
21:02
Performance optimization on nodeGetCell() in R-Tree. check-in: 5d20ff9e user: drh tags: rtree-enhancements
17:23
Convert the RTree module query mechanism over to using a priority queue for walking the RTree. check-in: f26936f7 user: drh tags: rtree-enhancements
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/rtree/rtree.c.

   725    725   */
   726    726   static void nodeGetCell(
   727    727     Rtree *pRtree,               /* The overall R-Tree */
   728    728     RtreeNode *pNode,            /* The node containing the cell to be read */
   729    729     int iCell,                   /* Index of the cell within the node */
   730    730     RtreeCell *pCell             /* OUT: Write the cell contents here */
   731    731   ){
   732         -  int ii;
          732  +  u8 *pData;
          733  +  u8 *pEnd;
          734  +  RtreeCoord *pCoord;
   733    735     pCell->iRowid = nodeGetRowid(pRtree, pNode, iCell);
   734         -  for(ii=0; ii<pRtree->nDim*2; ii++){
   735         -    nodeGetCoord(pRtree, pNode, iCell, ii, &pCell->aCoord[ii]);
          736  +  pData = pNode->zData + (12 + pRtree->nBytesPerCell*iCell);
          737  +  pEnd = pData + pRtree->nDim*8;
          738  +  pCoord = pCell->aCoord;
          739  +  for(; pData<pEnd; pData+=4, pCoord++){
          740  +    readCoord(pData, pCoord);
   736    741     }
   737    742   }
   738    743   
   739    744   
   740    745   /* Forward declaration for the function that does the work of
   741    746   ** the virtual table module xCreate() and xConnect() methods.
   742    747   */