Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix critical data race conditions + improve performance #6

Merged
merged 4 commits into from
Oct 17, 2020

Conversation

denis-tingaikin
Copy link
Contributor

#5

Signed-off-by: denis-tingajkin <denis.tingajkin@xored.com>
@denis-tingaikin denis-tingaikin changed the title proof of data race conditon Fix datarace conditions Oct 17, 2020
@denis-tingaikin denis-tingaikin marked this pull request as ready for review October 17, 2020 10:40
@denis-tingaikin
Copy link
Contributor Author

denis-tingaikin commented Oct 17, 2020

Before

BenchmarkExecutorAsync
BenchmarkExecutorAsync-8   	 5511322	       217 ns/op

BenchmarkExecutorSync
BenchmarkExecutorSync-8   	 1571877	       742 ns/op

After

BenchmarkExecutorAsync
BenchmarkExecutorAsync-8   	 5717280	       205 ns/op


BenchmarkExecutorSync
BenchmarkExecutorSync-8   	 1767159	       667 ns/op

Delta

BenchmarkExecutorAsync-8    	        	       -12  ns/op (5.5% faster)
BenchmarkExecutorSync-8     	        	       -75 ns/op (10.10% faster)

Signed-off-by: denis-tingajkin <denis.tingajkin@xored.com>
Signed-off-by: denis-tingajkin <denis.tingajkin@xored.com>
Signed-off-by: denis-tingajkin <denis.tingajkin@xored.com>
@denis-tingaikin denis-tingaikin changed the title Fix datarace conditions Fix critical data race conditions + improve performance Oct 17, 2020
f: f,
done: make(chan struct{}),
result := make(chan struct{})
e.orderCh <- func() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@edwarnicke Note: this channel should provide FIFO order of goroutines that called AsyncExec

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, it will 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants