2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-22 01:57:43 +00:00

Improve partitioning performance slightly by inserting new partitions

imediately after the current partition being considered, instead of
at the back of the parition list.  This does two things, it makes it
more likely the data is in cache, and it also in general results in
more partitions being created in a single pass.
This commit is contained in:
John Johansen 2010-01-31 23:12:33 -08:00
parent 69ebfc4cda
commit 1179c1a42c

View File

@ -1642,13 +1642,14 @@ void DFA::minimize(dfaflags_t flags)
partition_map.erase(*m);
partition_map.insert(make_pair(*m, new_part));
}
partitions.push_back(new_part);
list <States *>::iterator tmp = p;
partitions.insert(++tmp, new_part);
new_part_count++;
}
}
if ((flags & DFA_DUMP_PROGRESS) &&
(partitions.size() % 1000 == 0))
(partitions.size() % 100 == 0))
cerr << "\033[2KMinimize dfa: partitions " << partitions.size() << "\tinit " << init_count << "\t(accept " << accept_count << ")\r";
}
} while(new_part_count);
if (flags & DFA_DUMP_STATS)