locode: Use quadtree to find continent #830

Closed
Nesterfifa wants to merge 6 commits from Nesterfifa/frostfs-node:782-use-quadtree into master
Collaborator

Benchmarking results can be found in attachments
slow containts the result on master
mid -- this branch with <=4 CPUs on IterateAll
fast -- this branch with <=16 CPUs

Benchmarking results can be found in attachments `slow` containts the result on master `mid` -- this branch with <=4 CPUs on IterateAll `fast` -- this branch with <=16 CPUs
Nesterfifa added 1 commit 2023-11-28 11:40:38 +00:00
[#782] pkg: use quadtree to find continent
Some checks failed
Vulncheck / Vulncheck (pull_request) Failing after 1m45s
DCO action / DCO (pull_request) Successful in 2m0s
Build / Build Components (1.21) (pull_request) Successful in 5m11s
Build / Build Components (1.20) (pull_request) Successful in 5m17s
Tests and linters / Staticcheck (pull_request) Successful in 5m39s
Tests and linters / Lint (pull_request) Successful in 6m6s
Tests and linters / Tests (1.20) (pull_request) Successful in 7m59s
Tests and linters / Tests (1.21) (pull_request) Successful in 7m56s
Tests and linters / Tests with -race (pull_request) Successful in 7m51s
7578fd46e5
Signed-off-by: nesterfifa <vemeyzer@gmail.com>
Owner
  1. Could you mention the benchmark you used to compare?
  2. Can we add some local benchmarks here?
1. Could you mention the benchmark you used to compare? 2. Can we add some local benchmarks here?
dstepanov-yadro requested changes 2023-11-29 06:59:04 +00:00
@ -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.

Please drop this changes. These are generated files, so there is no need for automatic formatting.
dstepanov-yadro marked this conversation as resolved
fyrchik changed title from [#782] pkg: use quadtree to find continent to locode: Use quadtree to find continent 2023-11-30 13:14:19 +00:00
fyrchik approved these changes 2023-11-30 13:14:34 +00:00
@ -0,0 +14,4 @@
out = flag.String(locodeGenerateOutputFlag, "", "Target path for generated database")
)
func BenchmarkLocodeGenerate(b *testing.B) {
Owner

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.

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)
Owner

This change seems unrelated to the commit. Can we move it to a separate commit and describe the WHY?

git rebase and git reset commands might be helpful, especially git reset -p.

This change seems unrelated to the commit. Can we move it to a separate commit and describe the WHY? `git rebase` and `git reset` commands might be helpful, especially `git reset -p`.
dstepanov-yadro approved these changes 2023-11-30 13:46:32 +00:00
achuprov requested changes 2023-11-30 15:23:01 +00:00
@ -76,0 +91,4 @@
Max: orb.Point{180, 180},
})
for _, feature := range db.features {
Member
Is there a way to simplify this code? https://git.frostfs.info/TrueCloudLab/frostfs-node/src/commit/cff78d77c22b788a398a958a9a9d1f02b43b6148/pkg/util/locode/db/continents/geojson/calls.go#L94-L110
Author
Collaborator

Reduced the nesting depth to 2

Reduced the nesting depth to 2
Member

Please use capital letters in commit messages after :.

Please use capital letters in commit messages after `:`.
acid-ant approved these changes 2023-12-04 07:43:20 +00:00
Nesterfifa force-pushed 782-use-quadtree from cff78d77c2 to 91fe0d3531 2023-12-04 16:42:05 +00:00 Compare
Nesterfifa added 1 commit 2023-12-12 10:22:03 +00:00
[#782] locode: Simplify build quadtree
Some checks failed
Tests and linters / Lint (pull_request) Failing after 10s
DCO action / DCO (pull_request) Successful in 2m34s
Vulncheck / Vulncheck (pull_request) Failing after 3m7s
Build / Build Components (1.21) (pull_request) Successful in 3m57s
Tests and linters / Staticcheck (pull_request) Successful in 4m43s
Build / Build Components (1.20) (pull_request) Successful in 5m35s
Tests and linters / Tests (1.21) (pull_request) Successful in 8m8s
Tests and linters / Tests (1.20) (pull_request) Successful in 8m20s
Tests and linters / Tests with -race (pull_request) Successful in 8m14s
f31b4c1a7b
Signed-off-by: nesterfifa <vemeyzer@gmail.com>
fyrchik reviewed 2023-12-12 11:23:15 +00:00
@ -5,2 +5,4 @@
"os"
"github.com/paulmach/orb/quadtree"
Owner

Please, attach all non-stdlib imports in a single group (see paulmach/orb below).

Please, attach all non-stdlib imports in a single group (see `paulmach/orb` below).
Author
Collaborator

Fixed

Fixed
fyrchik marked this conversation as resolved
@ -76,0 +92,4 @@
})
for _, feature := range db.features {
multiPolygon := make(orb.MultiPolygon, 0)
Owner

What about var multiPolygon orb.MultiPolygon? make(_, 0) is usually never needed: nil acts good enough as the default value.

What about `var multiPolygon orb.MultiPolygon`? `make(_, 0)` is usually never needed: `nil` acts good enough as the default value.
Author
Collaborator

Fixed

Fixed
fyrchik marked this conversation as resolved
Nesterfifa added 1 commit 2023-12-12 11:35:18 +00:00
[#782] locode: Fix imports, var init
Some checks failed
DCO action / DCO (pull_request) Successful in 14m44s
Tests and linters / Staticcheck (pull_request) Successful in 16m33s
Vulncheck / Vulncheck (pull_request) Failing after 16m51s
Build / Build Components (1.21) (pull_request) Successful in 18m47s
Build / Build Components (1.20) (pull_request) Successful in 19m24s
Tests and linters / Tests (1.20) (pull_request) Failing after 20m0s
Tests and linters / Tests (1.21) (pull_request) Failing after 19m58s
Tests and linters / Tests with -race (pull_request) Failing after 19m55s
Tests and linters / Lint (pull_request) Successful in 22m48s
6999993fd2
Signed-off-by: nesterfifa <vemeyzer@gmail.com>
fyrchik approved these changes 2023-12-27 09:37:45 +00:00
fyrchik left a comment
Owner

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).

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.

Please, push these changes into [TrueCloudLab/frostfs-locode-db](https://git.frostfs.info/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.
Owner

Will be done in another repo TrueCloudLab/frostfs-locode-db#15

Will be done in another repo https://git.frostfs.info/TrueCloudLab/frostfs-locode-db/pulls/15
fyrchik closed this pull request 2024-10-02 07:29:11 +00:00
Some checks failed
DCO action / DCO (pull_request) Successful in 14m44s
Required
Details
Tests and linters / Staticcheck (pull_request) Successful in 16m33s
Required
Details
Vulncheck / Vulncheck (pull_request) Failing after 16m51s
Required
Details
Build / Build Components (1.21) (pull_request) Successful in 18m47s
Required
Details
Build / Build Components (1.20) (pull_request) Successful in 19m24s
Required
Details
Tests and linters / Tests (1.20) (pull_request) Failing after 20m0s
Required
Details
Tests and linters / Tests (1.21) (pull_request) Failing after 19m58s
Required
Details
Tests and linters / Tests with -race (pull_request) Failing after 19m55s
Required
Details
Tests and linters / Lint (pull_request) Successful in 22m48s
Required
Details

Pull request closed

Sign in to join this conversation.
No milestone
No project
No assignees
6 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#830
No description provided.