-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Upgrade go-msgpack to 2.1.1 #577
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package raft | ||
|
||
import ( | ||
"testing" | ||
"time" | ||
|
||
"github.com/hashicorp/go-hclog" | ||
) | ||
|
||
func BenchmarkStoreLogInMem(b *testing.B) { | ||
conf := DefaultConfig() | ||
conf.LocalID = "first" | ||
conf.HeartbeatTimeout = 50 * time.Millisecond | ||
conf.ElectionTimeout = 50 * time.Millisecond | ||
conf.LeaderLeaseTimeout = 50 * time.Millisecond | ||
conf.CommitTimeout = 5 * time.Millisecond | ||
conf.SnapshotThreshold = 100 | ||
conf.TrailingLogs = 10 | ||
conf.LogLevel = "OFF" | ||
raft := MakeRaft(b, conf, true) | ||
raft.logger.SetLevel(hclog.Off) | ||
|
||
NoErr(WaitFor(raft, Leader), b) | ||
|
||
applyAndWait := func(leader *RaftEnv, n, sz int) { | ||
// Do some commits | ||
var futures []ApplyFuture | ||
for i := 0; i < n; i++ { | ||
futures = append(futures, leader.raft.Apply(logBytes(i, sz), 0)) | ||
} | ||
for _, f := range futures { | ||
NoErr(WaitFuture(f), b) | ||
leader.logger.Debug("applied", "index", f.Index(), "size", sz) | ||
} | ||
} | ||
|
||
for i := 0; i < b.N; i++ { | ||
// Do some commits | ||
applyAndWait(raft, 100, 10) | ||
// Do a snapshot | ||
NoErr(WaitFuture(raft.raft.Snapshot()), b) | ||
} | ||
} | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,24 @@ | ||
module github.com/hashicorp/raft/fuzzy | ||
|
||
go 1.16 | ||
go 1.20 | ||
|
||
require ( | ||
github.com/boltdb/bolt v1.3.1 // indirect | ||
github.com/hashicorp/go-hclog v1.5.0 | ||
github.com/hashicorp/go-msgpack v0.5.5 | ||
github.com/hashicorp/go-msgpack/v2 v2.1.1 | ||
github.com/hashicorp/raft v1.2.0 | ||
github.com/hashicorp/raft-boltdb v0.0.0-20171010151810-6e5ba93211ea | ||
golang.org/x/sys v0.1.0 // indirect | ||
) | ||
|
||
require ( | ||
github.com/armon/go-metrics v0.4.1 // indirect | ||
github.com/boltdb/bolt v1.3.1 // indirect | ||
github.com/fatih/color v1.13.0 // indirect | ||
github.com/hashicorp/go-immutable-radix v1.0.0 // indirect | ||
github.com/hashicorp/go-msgpack v0.5.5 // indirect | ||
github.com/hashicorp/golang-lru v0.5.0 // indirect | ||
github.com/mattn/go-colorable v0.1.12 // indirect | ||
github.com/mattn/go-isatty v0.0.14 // indirect | ||
golang.org/x/sys v0.13.0 // indirect | ||
) | ||
|
||
replace github.com/hashicorp/raft => ../ |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this benchmark used to check before and after performance of the msgpack encoding? What were the results?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Differences were basically non-existent, as I suspect the disk I/O / sync was the dominant cost.