Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
d13cf4f
udpated Chain method impls
pavlov061356 Sep 26, 2024
e3b5644
added required functions and starting to write tests
pavlov061356 Sep 30, 2024
86ce61b
adding tests
pavlov061356 Oct 1, 2024
843e2d9
updating tests
pavlov061356 Oct 1, 2024
984d3f1
finished SimplePolylines test
pavlov061356 Oct 2, 2024
6d9b45f
finished with tests && fixing
pavlov061356 Oct 2, 2024
d5e1fb8
testing + fixing
pavlov061356 Oct 3, 2024
18c8000
finished with ChainINtepolationQueryTest
pavlov061356 Oct 4, 2024
95e8284
fixed PointVector Chain method
pavlov061356 Oct 4, 2024
d95a469
renamed InitChainInterpolationQuery
pavlov061356 Oct 4, 2024
3046c85
added docs
pavlov061356 Oct 4, 2024
665d021
typo
pavlov061356 Oct 4, 2024
bab758c
TestSlice update
pavlov061356 Oct 4, 2024
ded5834
updated TestChains
pavlov061356 Oct 4, 2024
94c0548
TestGetLengthAtEdgePolyline updated
pavlov061356 Oct 4, 2024
c052091
TestGetLengthAtEdgePolygon updated
pavlov061356 Oct 4, 2024
1a40a64
TestSimplePolylines updated
pavlov061356 Oct 4, 2024
47bb065
added SliceDivided
pavlov061356 Oct 4, 2024
409019d
add calculateDivisionsByEdge method
pavlov061356 Oct 7, 2024
3756e6b
starting to add benchmark on calculateDivisionsByEdge
pavlov061356 Oct 7, 2024
ad17ebc
adding tests for start and end edge ids for calculateDivisionsByEdge
pavlov061356 Oct 7, 2024
e6eb2de
updating SliceDivided
pavlov061356 Oct 8, 2024
c42b6ff
fixed & finished with ChainInterpolationQuery.AddSliceDivided
pavlov061356 Oct 14, 2024
c9f97d5
remove unused
pavlov061356 Oct 14, 2024
2ffcfa6
additional test
pavlov061356 Oct 14, 2024
9ca2a9b
try to rename module
pavlov061356 Oct 14, 2024
6bdb0c2
testing fix for overfill of SliceDivided
pavlov061356 Oct 16, 2024
dcffae9
testing fix for overfill of SliceDivided
pavlov061356 Oct 16, 2024
d57db6b
refactoring
pavlov061356 Nov 11, 2024
0119655
updated with non emptu slice
pavlov061356 Nov 11, 2024
8f84d8d
Merge branch 'ft/s2/add_chain_interpolation_query'
pavlov061356 Nov 11, 2024
b86616f
add benchmark on slice divided
pavlov061356 Nov 13, 2024
e9400b5
add benchmark results
pavlov061356 Nov 13, 2024
c5a9edf
updated alloc rate
pavlov061356 Nov 13, 2024
ea1220a
optimized memory allocation
pavlov061356 Nov 14, 2024
785e252
Merge branch 'ft/add_benchamarks'
pavlov061356 Nov 14, 2024
d02b7e1
add benchmark
pavlov061356 Nov 18, 2024
d398ea8
Update README.md
pavlov061356 Nov 20, 2024
cd9bd72
udpated length check
pavlov061356 Nov 22, 2024
fc6dc25
refactored filling divided slice
pavlov061356 Nov 22, 2024
d6fc39f
fixed reverse in SliceDivided
pavlov061356 Dec 11, 2024
e711090
updated to point with fraction to SliceDivided
pavlov061356 Dec 12, 2024
75f9537
Merge branch 'master' into ft/s2/add_chain_interpolation_query
pavlov061356 Apr 11, 2025
54d58af
slice divided update
pavlov061356 Apr 11, 2025
dcb138f
Merge branch 'master' into ft/s2/add_chain_interpolation_query
pavlov061356 Apr 11, 2025
7ea6a4b
review update
pavlov061356 Apr 11, 2025
7cfaa88
review updates
pavlov061356 Apr 11, 2025
b68cc23
package name fix
pavlov061356 Apr 11, 2025
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
Prev Previous commit
Next Next commit
optimized memory allocation
  • Loading branch information
pavlov061356 committed Nov 14, 2024
commit ea1220a9d098c7c3d45b860f1f5c98541e7c0f0a
2 changes: 1 addition & 1 deletion s2/chain_interpolation_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ func (s ChainInterpolationQuery) Slice(beginFraction, endFraction float64) []Poi
// If the query is either uninitialized, or initialized with a shape
// containing no edges, then an empty vector is returned.
func (s ChainInterpolationQuery) SliceDivided(beginFraction, endFraction float64, divisions int) []Point {
var points []Point
points := make([]Point, 0, divisions)
s.AddDividedSlice(beginFraction, endFraction, &points, divisions)
return points
}
Expand Down
14 changes: 13 additions & 1 deletion s2/chain_interpolation_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ func TestSliceDivided(t *testing.T) {
// cpu: AMD Ryzen 5 5600G with Radeon Graphics
// === RUN Benchmark_SliceDivided
// Benchmark_SliceDivided
// Benchmark_SliceDivided-12 8101 128452 ns/op 49104 B/op 20 allocs/op
// Benchmark_SliceDivided-12 8101 128452 ns/op 24577 B/op 2 allocs/op

func Benchmark_SliceDivided(b *testing.B) {
chainInterpolationQuery := InitChainInterpolationQuery(
Expand Down Expand Up @@ -928,3 +928,15 @@ func TestChainInterpolationQuery_EdgesBetween(t *testing.T) {
})
}
}

func Benchmark_InitChinInterpolationQuery(b *testing.B) {
points := make([]Point, 0, b.N)
for i := 0; i < b.N; i++ {
points = append(points, PointFromLatLng(LatLngFromDegrees(0, float64(i))))
}

b.ResetTimer()
for i := 0; i < b.N; i++ {
InitChainInterpolationQuery(laxPolylineFromPoints(points), 0)
}
}