Skip to content

Commit

Permalink
docs: add migration section
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Larkin <[email protected]>
  • Loading branch information
plar committed Dec 16, 2024
1 parent 51b2cc7 commit 75efc70
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,28 @@ func main() {

Check out the documentation on [pkg.go.dev/github.com/plar/go-adaptive-radix-tree/v2](https://pkg.go.dev/github.com/plar/go-adaptive-radix-tree/v2).

# Migration from v1 to v2

- update `import` statement

```
from `art "github.com/plar/go-adaptive-radix-tree"`
to `art "github.com/plar/go-adaptive-radix-tree/v2"`
```

- update go module dependency

```
$ go get github.com/plar/go-adaptive-radix-tree/v2
$ go mod tidy
```

If you had implemented your own version of the `Tree` interface, then you need to update the following method to support `options`. These are the only changes in the interface.

```
ForEachPrefix(keyPrefix Key, callback Callback, options ...int)
```

# Performance

[plar/go-adaptive-radix-tree](https://github.com/plar/go-adaptive-radix-tree) outperforms [kellydunn/go-art](https://github.com/kellydunn/go-art) by avoiding memory allocations during search operations.
Expand Down

0 comments on commit 75efc70

Please sign in to comment.