Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Performance improvements to spiral, counter, histogram & spiral_uniform
Changes include: Partition counter and spiral writes by erlang:system_info(scheduler_id) and a bitwise mask. There is also potential for better cache behavior given the fixed mapping between Erlang scheduler thread and partitioned key. Switch spiral and slide_uniform from ordered_set to set. Set supports fine grained locking whereas ordered_set requires a full-table lock. Combining set and separating values greatly reduces ETS contention. Change histogram to avoid an ETS insert if the sample passed into the histogram update function matches the result. There are 2 places in folsom where an ets:insert_new is done immediately followed by an ets:update_counter on the same key. Since, in the normal case, the key is likely to already exist, this can be optimized by trying the update_counter first in a try/catch and only do the insert_new if needed. This is provided as a utility function called folsom_utils:update_counter(). There is a bug in slide_uniform where it would not decrease the probability of doing a write the more updates it received in a particular moment. Effectively slide_uniform updates would always result in a write. This bug has been corrected, along with the Quickcheck test.
- Loading branch information
Showing
8 changed files
with
129 additions
and
40 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
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
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
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