Skip to content

Commit 57027b3

Browse files
committed
release: prepare the 0.2.1 release (#98)
* docs: update version in Cargo.toml to 0.2.1 * docs: update changelog to 0.2.1 * refactor: make clippy happy * docs: put the speed improvements in changelog * docs: update release date of 0.2.1
1 parent 2ca8446 commit 57027b3

File tree

3 files changed

+34
-4
lines changed

3 files changed

+34
-4
lines changed

CHANGELOG.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,34 @@ All notable changes to this project will be documented in this file.
44

55
## Unreleased [(diff)][unreleased-diff]
66

7+
## [0.2.1] - 2021-06-30 - [(diff with 0.2.0)][0.2.0-diff]
8+
9+
This release is focused on performance improvements and code readability, without any change to the public API.
10+
11+
The code tends to be simpler around tricky parts of the algorithm such as conflict resolution.
12+
Some data structures have been rewritten (with no unsafe) to lower memory usage.
13+
Depending on scenarios, version 0.2.1 is 3 to 8 times faster than 0.2.0.
14+
As an example, solving all elm package versions existing went from 580ms to 175ms on my laptop.
15+
While solving a specific subset of packages from crates.io went from 2.5s to 320ms on my laptop.
16+
17+
Below are listed all the important changes in the internal parts of the API.
18+
19+
#### Added
20+
21+
- New `SmallVec` data structure (with no unsafe) using fixed size arrays for up to 2 entries.
22+
- New `SmallMap` data structure (with no unsafe) using fixed size arrays for up to 2 entries.
23+
- New `Arena` data structure (with no unsafe) backed by a `Vec` and indexed with `Id<T>` where `T` is phantom data.
24+
25+
#### Changed
26+
27+
- Updated the `large_case` benchmark to run with both u16 and string package identifiers in registries.
28+
- Use the new `Arena` for the incompatibility store, and use its `Id<T>` identifiers to reference incompatibilities instead of full owned copies in the `incompatibilities` field of the solver `State`.
29+
- Save satisfier indices of each package involved in an incompatibility when looking for its satisfier. This speeds up the search for the previous satisfier.
30+
- Early unit propagation loop restart at the first conflict found instead of continuing evaluation for the current package.
31+
- Index incompatibilities by package in a hash map instead of using a vec.
32+
- Keep track of already contradicted incompatibilities in a `Set` until the next backtrack to speed up unit propagation.
33+
- Unify `history` and `memory` in `partial_solution` under a unique hash map indexed by packages. This should speed up access to relevan terms in conflict resolution.
34+
735
## [0.2.0] - 2020-11-19 - [(diff with 0.1.0)][0.1.0-diff]
836

937
This release brings many important improvements to PubGrub.
@@ -133,7 +161,10 @@ The gist of it is:
133161
- `.gitignore` configured for a Rust project.
134162
- `.github/workflows/` CI to automatically build, test and document on push and pull requests.
135163

164+
[0.2.1]: https://github.com/pubgrub-rs/pubgrub/releases/tag/v0.2.1
136165
[0.2.0]: https://github.com/pubgrub-rs/pubgrub/releases/tag/v0.2.0
137-
[0.1.0-diff]: https://github.com/pubgrub-rs/pubgrub/compare/v0.1.0...v0.2.0
138166
[0.1.0]: https://github.com/pubgrub-rs/pubgrub/releases/tag/v0.1.0
167+
139168
[unreleased-diff]: https://github.com/pubgrub-rs/pubgrub/compare/release...dev
169+
[0.2.0-diff]: https://github.com/pubgrub-rs/pubgrub/compare/v0.2.0...v0.2.1
170+
[0.1.0-diff]: https://github.com/pubgrub-rs/pubgrub/compare/v0.1.0...v0.2.0

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[package]
44
name = "pubgrub"
5-
version = "0.2.0"
5+
version = "0.2.1"
66
authors = [
77
"Matthieu Pizenberg <[email protected]>",
88
"Alex Tokarev <[email protected]>",

src/report.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,11 @@ impl DefaultStringReporter {
263263
// recursively call on the second node,
264264
// and finally conclude.
265265
(None, None) => {
266+
self.build_recursive(derived1);
266267
if derived1.shared_id != None {
267-
self.build_recursive(derived1);
268268
self.lines.push("".into());
269269
self.build_recursive(current);
270270
} else {
271-
self.build_recursive(derived1);
272271
self.add_line_ref();
273272
let ref1 = self.ref_count;
274273
self.lines.push("".into());

0 commit comments

Comments
 (0)