8000 Increase pathfinder map fill ratio to 0.99 and update dependencies by kelindar · Pull Request #16 · kelindar/tile · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Increase pathfinder map fill ratio to 0.99 and update dependencies #16

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

Merged
merged 1 commit into from
May 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module github.com/kelindar/tile

go 1.23
go 1.24

require (
github.com/kelindar/intmap v1.4.1
github.com/kelindar/intmap v1.5.0
github.com/kelindar/iostream v1.4.0
github.com/stretchr/testify v1.9.0
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/kelindar/intmap v1.4.1 h1:3jTPTrfNx4pxBPURR1+6f4YhbZS57CzsU0S9NEV51ZI=
github.com/kelindar/intmap v1.4.1/go.mod h1:NkypxhfaklmDTJqwano3Q1BWk6je77qgQwszDwu8Kc8=
github.com/kelindar/intmap v1.5.0 h1:VY+AdO4Wx1sF1vGiTkS8n2lxhmFgOQwCIFuePQP4Iqw=
github.com/kelindar/intmap v1.5.0/go.mod h1:NkypxhfaklmDTJqwano3Q1BWk6je77qgQwszDwu8Kc8=
github.com/kelindar/iostream v1.4.0 h1:ELKlinnM/K3GbRp9pYhWuZOyBxMMlYAfsOP+gauvZaY=
github.com/kelindar/iostream v1.4.0/go.mod h1:MkjMuVb6zGdPQVdwLnFRO0xOTOdDvBWTztFmjRDQkXk=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand Down
4 changes: 2 additions & 2 deletions path.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ type pathfinder struct {
var pathfinders = sync.Pool{
New: func() any {
return &pathfinder{
edges: intmap.New(32, .95),
edges: intmap.NewWithFill(32, .99),
frontier: newFrontier(),
}
},
Expand All @@ -169,7 +169,7 @@ var pathfinders = sync.Pool{
func acquire(capacity int) *pathfinder {
v := pathfinders.Get().(*pathfinder)
if v.edges.Capacity() < capacity {
v.edges = intmap.New(capacity, .95)
v.edges = intmap.NewWithFill(capacity, .99)
}

return v
Expand Down
14 changes: 7 additions & 7 deletions path_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ func TestDraw(t *testing.T) {
}

/*
BenchmarkPath/9x9-24 2704395 440.4 ns/op 256 B/op 1 allocs/op
BenchmarkPath/300x300-24 1134 1033808 ns/op 3845 B/op 4 allocs/op
BenchmarkPath/381x381-24 2782 377676 ns/op 7298 B/op 5 allocs/op
BenchmarkPath/384x384-24 2716 382663 ns/op 7298 B/op 5 allocs/op
BenchmarkPath/3069x3069-24 847 1368243 ns/op 100140 B/op 7 allocs/op
BenchmarkPath/3072x3072-24 849 1368387 ns/op 99954 B/op 7 allocs/op
BenchmarkPath/6144x6144-24 3050 387195 ns/op 12802 B/op 5 allocs/op
BenchmarkPath/9x9-24 2856020 423.0 ns/op 256 B/op 1 allocs/op
BenchmarkPath/300x300-24 1167 1006143 ns/op 3845 B/op 4 allocs/op
BenchmarkPath/381x381-24 3150 371478 ns/op 12629 B/op 5 allocs/op
BenchmarkPath/384x384-24 3178 374982 ns/op 7298 B/op 5 allocs/op
BenchmarkPath/3069x3069-24 787 1459683 ns/op 106188 B/op 7 allocs/op
BenchmarkPath/3072x3072-24 799 1552230 ns/op 104906 B/op 7 allocs/op
BenchmarkPath/6144x6144-24 3099 381935 ns/op 12716 B/op 5 allocs/op
*/
func BenchmarkPath(b *testing.B) {
b.Run("9x9", func(b *testing.B) {
Expand Down
0