-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use a custom allocator with a single cache slot
This commit implements a wrapper around new/delete as the struct, Allocator. This struct caches the last thing that was deleted and uses it for allocation the next time it is called upon. In our domain, this works because (1) we do all our new/deletes in pseudo lock step (we never have two 'deletes' without a 'new' in-between) and (2) our allocations are all statically localised to threads, so we can get away without any locking in the allocator. This seems both trivial and over-engineered. However, it makes a significant practical difference. In my current work horse, long-running2, this takes the single-threaded checker from 90 seconds down to 51 and the 4-threaded checker from 117 seconds down to 85. Related to Github #6 "Multithreaded optimisation"
- Loading branch information
Showing
2 changed files
with
45 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters