From 6592197ee64e1a1d4f1c7db3573895ddce617571 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 20 May 2010 22:16:03 -0600 Subject: Store the bounding boxes of child PR-tree nodes in the parent. This improves cache locality and is good for about a 10% performance boost. --- libdimension/prtree.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libdimension/prtree.h') diff --git a/libdimension/prtree.h b/libdimension/prtree.h index 1f2dd29..eab359d 100644 --- a/libdimension/prtree.h +++ b/libdimension/prtree.h @@ -34,12 +34,12 @@ #define DMNSN_PRTREE_B 6 typedef struct dmnsn_prtree_node { + dmnsn_bounding_box bounding_box; + /* Children (objects or subtrees) */ - void *children[DMNSN_PRTREE_B]; bool is_leaf; - - /* Bounding box */ - dmnsn_bounding_box bounding_box; + void *children[DMNSN_PRTREE_B]; + dmnsn_bounding_box bounding_boxes[DMNSN_PRTREE_B]; } dmnsn_prtree_node; typedef struct dmnsn_prtree { -- cgit v1.2.3