Jonathan Bluett-Duncan
bdcda9a453
graph: use slices package for sorting and reversing slices
2024-08-17 08:41:18 +09:30
Dan Kortschak
2bef024c93
graph/iterator: improve reflect-based iterators
...
- use SetIterValue to reduce allocations
- use explicit stored iterator length
goos: linux
goarch: amd64
pkg: gonum.org/v1/gonum/graph/traverse
cpu: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
│ old.bench │ new.bench │
│ sec/op │ sec/op vs base │
WalkAllBreadthFirstGnp_10_tenth-8 3.575µ ± 2% 2.961µ ± 2% -17.18% (p=0.000 n=20)
WalkAllBreadthFirstGnp_100_tenth-8 144.4µ ± 1% 132.4µ ± 1% -8.33% (p=0.000 n=20)
WalkAllBreadthFirstGnp_1000_tenth-8 12.66m ± 2% 12.00m ± 2% -5.20% (p=0.000 n=20)
WalkAllBreadthFirstGnp_10_half-8 8.415µ ± 1% 7.615µ ± 1% -9.51% (p=0.000 n=20)
WalkAllBreadthFirstGnp_100_half-8 628.0µ ± 1% 580.7µ ± 1% -7.54% (p=0.000 n=20)
WalkAllBreadthFirstGnp_1000_half-8 58.74m ± 1% 55.79m ± 2% -5.03% (p=0.000 n=20)
WalkAllDepthFirstGnp_10_tenth-8 3.539µ ± 2% 2.956µ ± 1% -16.49% (p=0.000 n=20)
WalkAllDepthFirstGnp_100_tenth-8 144.8µ ± 2% 135.5µ ± 1% -6.40% (p=0.000 n=20)
WalkAllDepthFirstGnp_1000_tenth-8 12.40m ± 1% 12.02m ± 1% -3.10% (p=0.000 n=20)
WalkAllDepthFirstGnp_10_half-8 8.210µ ± 1% 7.423µ ± 1% -9.59% (p=0.000 n=20)
WalkAllDepthFirstGnp_100_half-8 625.8µ ± 1% 598.3µ ± 1% -4.40% (p=0.000 n=20)
WalkAllDepthFirstGnp_1000_half-8 58.28m ± 1% 55.65m ± 1% -4.52% (p=0.000 n=20)
geomean 353.9µ 324.8µ -8.21%
│ old.bench │ new.bench │
│ B/op │ B/op vs base │
WalkAllBreadthFirstGnp_10_tenth-8 1.533Ki ± 0% 1.486Ki ± 0% -3.06% (p=0.000 n=20)
WalkAllBreadthFirstGnp_100_tenth-8 29.58Ki ± 0% 29.61Ki ± 0% +0.11% (p=0.000 n=20)
WalkAllBreadthFirstGnp_1000_tenth-8 1016.3Ki ± 0% 1016.4Ki ± 0% ~ (p=0.199 n=20)
WalkAllBreadthFirstGnp_10_half-8 2.689Ki ± 0% 2.721Ki ± 0% +1.16% (p=0.000 n=20)
WalkAllBreadthFirstGnp_100_half-8 61.44Ki ± 0% 61.47Ki ± 0% +0.05% (p=0.000 n=20)
WalkAllBreadthFirstGnp_1000_half-8 4.036Mi ± 0% 4.036Mi ± 0% ~ (p=0.080 n=20)
WalkAllDepthFirstGnp_10_tenth-8 1.533Ki ± 0% 1.486Ki ± 0% -3.06% (p=0.000 n=20)
WalkAllDepthFirstGnp_100_tenth-8 29.58Ki ± 0% 29.61Ki ± 0% +0.10% (p=0.000 n=20)
WalkAllDepthFirstGnp_1000_tenth-8 1.090Mi ± 1% 1.084Mi ± 1% ~ (p=0.081 n=20)
WalkAllDepthFirstGnp_10_half-8 2.689Ki ± 0% 2.721Ki ± 0% +1.16% (p=0.000 n=20)
WalkAllDepthFirstGnp_100_half-8 61.57Ki ± 0% 61.59Ki ± 0% +0.04% (p=0.000 n=20)
WalkAllDepthFirstGnp_1000_half-8 6.279Mi ± 0% 6.167Mi ± 0% -1.79% (p=0.000 n=20)
geomean 58.77Ki 58.48Ki -0.49%
│ old.bench │ new.bench │
│ allocs/op │ allocs/op vs base │
WalkAllBreadthFirstGnp_10_tenth-8 27.00 ± 0% 17.00 ± 0% -37.04% (p=0.000 n=20)
WalkAllBreadthFirstGnp_100_tenth-8 1.188k ± 0% 1.088k ± 0% -8.42% (p=0.000 n=20)
WalkAllBreadthFirstGnp_1000_tenth-8 102.1k ± 0% 101.1k ± 0% -0.98% (p=0.000 n=20)
WalkAllBreadthFirstGnp_10_half-8 70.00 ± 0% 60.00 ± 0% -14.29% (p=0.000 n=20)
WalkAllBreadthFirstGnp_100_half-8 5.266k ± 0% 5.166k ± 0% -1.90% (p=0.000 n=20)
WalkAllBreadthFirstGnp_1000_half-8 500.9k ± 0% 499.9k ± 0% -0.20% (p=0.000 n=20)
WalkAllDepthFirstGnp_10_tenth-8 27.00 ± 0% 17.00 ± 0% -37.04% (p=0.000 n=20)
WalkAllDepthFirstGnp_100_tenth-8 1.188k ± 0% 1.088k ± 0% -8.42% (p=0.000 n=20)
WalkAllDepthFirstGnp_1000_tenth-8 102.1k ± 0% 101.1k ± 0% -0.98% (p=0.000 n=20)
WalkAllDepthFirstGnp_10_half-8 70.00 ± 0% 60.00 ± 0% -14.29% (p=0.000 n=20)
WalkAllDepthFirstGnp_100_half-8 5.266k ± 0% 5.166k ± 0% -1.90% (p=0.000 n=20)
WalkAllDepthFirstGnp_1000_half-8 500.9k ± 0% 499.9k ± 0% -0.20% (p=0.000 n=20)
geomean 2.908k 2.572k -11.54%
2024-05-24 20:49:39 +09:30
Dan Kortschak
f853624cb1
graph/iterator: allocate reflect map iterator inline
2024-05-17 20:05:25 +09:30
Jonathan Bluett-Duncan
fe73977b01
internal/order: move package from graph/internal/ordered and make function generic
2024-05-11 21:57:13 +09:30
Eng Zer Jun
7d22d85fb1
graph: fix comment of exported elements
...
According to Comment Sentences at github.com/golang [1], it is a
convention to begin a comment with the name of the exported element.
[1]: https://github.com/golang/go/wiki/CodeReviewComments#comment-sentences
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com >
2023-09-23 11:30:23 +09:30
Dan Kortschak
5f0141ca4c
all: run gofmt and generate all packages
...
Changes made in dsp/fourier/internal/fftpack break the formatting used
there, so these are reverted. There will be complaints in CI.
[git-generate]
gofmt -w .
go generate gonum.org/v1/gonum/blas
go generate gonum.org/v1/gonum/blas/gonum
go generate gonum.org/v1/gonum/unit
go generate gonum.org/v1/gonum/unit/constant
go generate gonum.org/v1/gonum/graph/formats/dot
go generate gonum.org/v1/gonum/graph/formats/rdf
go generate gonum.org/v1/gonum/stat/card
git checkout -- dsp/fourier/internal/fftpack
2022-08-06 07:05:17 +09:30
Dan Kortschak
7509ddb1e3
ci,mod,graph/iterator: bump minimum version to go1.18
2022-08-06 07:05:17 +09:30
Dan Kortschak
a2c6f817bf
ci: replace golangci-lint with staticcheck
2022-05-18 21:35:57 +09:30
Dan Kortschak
c787be45ba
graph/iterator: avoid stack copies of hiter
...
See https://go-review.googlesource.com/c/go/+/360254
2021-11-01 22:43:31 +10:30
Dan Kortschak
8f6a7707f4
graph/internal/ordered: replace slice sort types with sort.Slice calls
2021-10-14 07:01:58 +10:30
Dan Kortschak
cccd8af5f6
graph/iterator: update map iteration to tolerate changes in reflect
...
https://go-review.googlesource.com/c/go/+/321889
2021-09-28 21:54:50 +09:30
Dan Kortschak
a382475b2c
graph/iterator: fix English
2021-06-25 08:14:19 +09:30
Dan Kortschak
5ed7775611
graph/{iterator,multi}: use map iterators for lines and weighted lines
2021-06-25 08:14:19 +09:30
Dan Kortschak
22615bc090
graph/iterator: fix Len for depleted ImplicitNodesIterator
2021-04-26 15:38:09 +09:30
Dan Kortschak
ccc0da248a
all: run make builds pass with go master
...
Run gofmt go1.17 adds the new //go:build comments
2021-04-19 15:00:56 +09:30
Dan Kortschak
2599150152
all: remove appengine build tag and test with safe
2020-09-07 19:10:11 +09:30
Dan Kortschak
39cd12e938
graph/iterator: add lazy ordered node iterators
2020-07-02 07:47:46 +09:30
Dan Kortschak
2db33926ac
graph/iterator: extend iteration tests and fix counting error
2020-07-02 07:47:46 +09:30
Dan Kortschak
16da37cc66
graph/iterator: implement unsafe node iterators
2020-07-02 07:47:46 +09:30
Dan Kortschak
91d83a4f35
graph/iterator: add fast paths for node slices and add tests
...
Fix bugs in NodeSlice methods:
- ImplicitNodes did not return nil for an empty set of nodes.
- OrderedNodes returned one too many nodes if Next has been called.
2020-07-02 07:47:46 +09:30
Dan Kortschak
d4ef54c821
graph/iterator: implement edge and line based lazy node iterator
2020-07-02 07:47:46 +09:30
Dan Kortschak
2a132c9421
graph/iterator: consolidate node iterators
2019-10-13 07:56:07 +10:30
Dan Kortschak
dafd13b32d
graph/iterator: guard against iteration panic
...
The reflect package panics when any of Key, Value or Next are called
after Next returns false. We don't do that in the other iterators, so
we shouldn't do it here.
2019-07-20 21:02:08 +09:30
Dan Kortschak
b8a36307b8
graph/iterator: properly test iterator reset
2019-07-20 19:50:24 +09:30
Dan Kortschak
2120b82d14
graph/iterator: add unordered node iterator
2019-07-20 18:24:32 +09:30
Dan Kortschak
761876748e
graph: make edges and lines reversible
2019-03-13 07:14:55 +10:30
Dan Kortschak
2df0688894
graph/simple: test graph implementations with testgraph package
...
Fix bugs found by testgraph.
2018-11-21 11:35:03 +10:30
Dan Kortschak
b73a2c92ff
graph: add node, edge and line iterators
2018-09-23 09:25:56 +09:30