-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed more allocations + other optimizations
The most noisy change is that all public APIs are now marked as inline, allowing the optimizer to see through many APIs. This produces nearly identical results to enabling LTO. The next optimization was to change read_buffered_bytes to reuse a scratch buffer. This allows buffered reads to share a single allocation, preventing many tiny allocations when reading things like bytes/strings from a reader. The final big optimization was to make SymbolMap store its list of 'ephemeral' strings in a single String, only storing the offsets. This further reduced the number of allocations deserializing data required. Some minor optimizations to how headers are encoded to optimize for the most common paths also have been made. All said, these changes account for ~10% improvement in the logs benchmark on average, depending on the data set.
- Loading branch information
Showing
11 changed files
with
600 additions
and
179 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
[workspace] | ||
members = ["xtask", "pot"] | ||
members = ["xtask", "pot", "benchmarks"] | ||
|
||
[profile.bench] | ||
# debug = true | ||
lto = true |
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,24 @@ | ||
[package] | ||
name = "benchmarks" | ||
version = "0.0.0" | ||
edition = "2021" | ||
publish = false | ||
|
||
[dependencies] | ||
serde = { version = "1.0.136", features = ["derive"] } | ||
pot = { path = "../pot" } | ||
rand = "0.8.4" | ||
fake = "2.4.3" | ||
chrono = { version = "0.4.19", features = ["serde"] } | ||
anyhow = "1.0.53" | ||
cli-table = "0.4.6" | ||
thousands = "0.2.0" | ||
ciborium = "0.2.0" | ||
bincode = "1.3.3" | ||
rmp-serde = "1.1.0" | ||
criterion = { version = "0.5", features = ["html_reports"] } | ||
|
||
|
||
[[bench]] | ||
name = "benchmarks" | ||
harness = false |
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
File renamed without changes.
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.