locode: Use quadtree to find continent #830
No reviewers
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
6 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#830
Loading…
Reference in a new issue
No description provided.
Delete branch "Nesterfifa/frostfs-node:782-use-quadtree"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Benchmarking results can be found in attachments
slow
containts the result on mastermid
-- this branch with <=4 CPUs on IterateAllfast
-- this branch with <=16 CPUs@ -12,2 +10,4 @@
reflect "reflect"
sync "sync"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
Please drop this changes. These are generated files, so there is no need for automatic formatting.
[#782] pkg: use quadtree to find continentto locode: Use quadtree to find continent@ -0,0 +14,4 @@
out = flag.String(locodeGenerateOutputFlag, "", "Target path for generated database")
)
func BenchmarkLocodeGenerate(b *testing.B) {
Could you also attach benchmark results on master vs this branch?
You can use https://pkg.go.dev/golang.org/x/perf/cmd/benchstat to compare gobench results.
@ -81,3 +81,3 @@
// Pick some sane default, after this the performance stopped increasing.
errG.SetLimit(runtime.NumCPU() * 4)
errG.SetLimit(runtime.NumCPU() * 16)
This change seems unrelated to the commit. Can we move it to a separate commit and describe the WHY?
git rebase
andgit reset
commands might be helpful, especiallygit reset -p
.@ -76,0 +91,4 @@
Max: orb.Point{180, 180},
})
for _, feature := range db.features {
Is there a way to simplify this code?
cff78d77c2/pkg/util/locode/db/continents/geojson/calls.go (L94-L110)
Reduced the nesting depth to 2
Please use capital letters in commit messages after
:
.cff78d77c2
to91fe0d3531
@ -5,2 +5,4 @@
"os"
"github.com/paulmach/orb/quadtree"
Please, attach all non-stdlib imports in a single group (see
paulmach/orb
below).Fixed
@ -76,0 +92,4 @@
})
for _, feature := range db.features {
multiPolygon := make(orb.MultiPolygon, 0)
What about
var multiPolygon orb.MultiPolygon
?make(_, 0)
is usually never needed:nil
acts good enough as the default value.Fixed
LTGM
The last commit with import fix could be squashed onto an earlier one: it is nice when every commit passes all linter checks, not just the top of the PR (we do not squash on merge).
Please, push these changes into TrueCloudLab/frostfs-locode-db. frostfs-node should depends on frostfs-locode-db Go package (https://git.frostfs.info/TrueCloudLab/frostfs-locode-db/pkg/locode) now, because we want to eliminate inter-dependencies between frostfs-node and frostfs-locode-db.
Will be done in another repo TrueCloudLab/frostfs-locode-db#15
Pull request closed