From 2ea143283c6c0c046aef8d1735c85571f8cc0baa Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sat, 16 Mar 2013 21:51:41 +0900 Subject: [PATCH] Rewrite mightsee_more to manipulate the sets directly. While using set operators was clearer, it was rather expensive (about 25s for gmsp3v2). qfvis now completes the map in about 695s (single threaded). About 15s faster than tyr for the same conditions (1 thread, level 4). --- tools/qfvis/source/flow.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tools/qfvis/source/flow.c b/tools/qfvis/source/flow.c index ca30ad71c..0439ef9e4 100644 --- a/tools/qfvis/source/flow.c +++ b/tools/qfvis/source/flow.c @@ -234,9 +234,16 @@ static inline int mightsee_more (set_t *might, const set_t *prev_might, const set_t *test, const set_t *vis) { - set_assign (might, prev_might); - set_intersection (might, test); - return !set_is_subset (vis, might); + unsigned i; + set_bits_t more = 0; + + // might = intersection (prev_might, test) + // more = (might is not a subset of vis) + for (i = 0; i < SET_WORDS (might); i++) { + might->map[i] = prev_might->map[i] & test->map[i]; + more |= might->map[i] & ~vis->map[i]; + } + return more != 0; } /*