Skip to content
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

reconciler: Drop out-of-sync metric and changed parameter from Update #28

Merged
merged 1 commit into from
May 9, 2024

Conversation

joamaki
Copy link
Contributor

@joamaki joamaki commented May 8, 2024

The "changed *bool" passed to Update() was confusing and it was often not easy or cheap to check whether the target had the expected value or not.

Let's err on the side of simplicity and drop the "out-of-sync" metric for the time being.

@joamaki joamaki requested a review from bimmlerd May 8, 2024 14:22
The "changed *bool" passed to Update() was confusing and it was often
not easy or cheap to check whether the target had the expected value or
not.

Let's err on the side of simplicity and drop the "out-of-sync" metric
for the time being.

Signed-off-by: Jussi Maki <[email protected]>
@joamaki joamaki force-pushed the pr/joamaki/drop-out-of-sync-metric branch from e656e16 to f433876 Compare May 8, 2024 14:22
Copy link

github-actions bot commented May 8, 2024

$ make test
go: downloading github.com/mitchellh/mapstructure v1.5.0
go: downloading golang.org/x/term v0.16.0
go: downloading github.com/fsnotify/fsnotify v1.7.0
go: downloading github.com/sagikazarmark/slog-shim v0.1.0
go: downloading github.com/spf13/afero v1.11.0
go: downloading github.com/spf13/cast v1.6.0
go: downloading golang.org/x/sys v0.17.0
go: downloading golang.org/x/text v0.14.0
go: downloading github.com/subosito/gotenv v1.6.0
go: downloading github.com/hashicorp/hcl v1.0.0
go: downloading gopkg.in/ini.v1 v1.67.0
go: downloading github.com/magiconair/properties v1.8.7
go: downloading github.com/pelletier/go-toml/v2 v2.1.0
	github.com/cilium/statedb/reconciler/example		coverage: 0.0% of statements
	github.com/cilium/statedb/reconciler/benchmark		coverage: 0.0% of statements
ok  	github.com/cilium/statedb	5.364s	coverage: 88.0% of statements
ok  	github.com/cilium/statedb/index	0.004s	coverage: 25.5% of statements
ok  	github.com/cilium/statedb/internal	0.012s	coverage: 93.3% of statements
ok  	github.com/cilium/statedb/part	1.825s	coverage: 85.9% of statements
ok  	github.com/cilium/statedb/reconciler	5.469s	coverage: 89.8% of statements
-----
$ make bench
go test ./... -bench . -benchmem -test.run xxx
goos: linux
goarch: amd64
pkg: github.com/cilium/statedb
cpu: AMD EPYC 7763 64-Core Processor                
BenchmarkDB_WriteTxn_1-4                    	  460203	      2520 ns/op	    396862 objects/sec	    2688 B/op	      32 allocs/op
BenchmarkDB_WriteTxn_10-4                   	 1243246	       950.3 ns/op	   1052351 objects/sec	     712 B/op	      10 allocs/op
BenchmarkDB_WriteTxn_100-4                  	 1586864	       757.4 ns/op	   1320319 objects/sec	     583 B/op	       7 allocs/op
BenchmarkDB_WriteTxn_1000-4                 	 1520142	       791.0 ns/op	   1264161 objects/sec	     535 B/op	       7 allocs/op
BenchmarkDB_WriteTxn_10000-4                	 1000000	      1024 ns/op	    976960 objects/sec	     550 B/op	       7 allocs/op
BenchmarkDB_WriteTxn_100_SecondaryIndex-4   	  533670	      2212 ns/op	    452153 objects/sec	    1670 B/op	      30 allocs/op
BenchmarkDB_RandomInsert-4                  	    2431	    482978 ns/op	   2070486 objects/sec	  386042 B/op	    7099 allocs/op
BenchmarkDB_RandomReplace-4                 	     432	   2775412 ns/op	    360307 objects/sec	 1861151 B/op	   31561 allocs/op
BenchmarkDB_SequentialInsert-4              	    1548	    792643 ns/op	   1261603 objects/sec	  535180 B/op	    7289 allocs/op
BenchmarkDB_Changes_Baseline-4              	    1264	    954267 ns/op	   1047926 objects/sec	  536201 B/op	   10246 allocs/op
BenchmarkDB_Changes-4                       	     699	   1700864 ns/op	    587937 objects/sec	  963723 B/op	   14540 allocs/op
BenchmarkDB_RandomLookup-4                  	   21249	     56908 ns/op	  17572276 objects/sec	     144 B/op	       1 allocs/op
BenchmarkDB_SequentialLookup-4              	   23938	     51020 ns/op	  19600104 objects/sec	       0 B/op	       0 allocs/op
BenchmarkDB_FullIteration_All-4             	     783	   1626672 ns/op	  61475323 objects/sec	     360 B/op	       7 allocs/op
BenchmarkDB_FullIteration_Get-4             	     196	   6291045 ns/op	  15895644 objects/sec	       0 B/op	       0 allocs/op
BenchmarkDB_PropagationDelay-4              	  512992	      2263 ns/op	        19.00 50th_µs	        23.00 90th_µs	        95.00 99th_µs	    1502 B/op	      24 allocs/op
PASS
ok  	github.com/cilium/statedb	25.185s
PASS
ok  	github.com/cilium/statedb/index	0.004s
PASS
ok  	github.com/cilium/statedb/internal	0.003s
goos: linux
goarch: amd64
pkg: github.com/cilium/statedb/part
cpu: AMD EPYC 7763 64-Core Processor                
Benchmark_Insert_RootOnlyWatch-4    	    9836	    124042 ns/op	   8061795 objects/sec	  104127 B/op	    2041 allocs/op
Benchmark_Insert-4                  	    6583	    170358 ns/op	   5869990 objects/sec	  202687 B/op	    3065 allocs/op
Benchmark_Replace-4                 	29505416	        40.67 ns/op	  24585779 objects/sec	       0 B/op	       0 allocs/op
Benchmark_Replace_RootOnlyWatch-4   	29366436	        40.67 ns/op	  24587031 objects/sec	       0 B/op	       0 allocs/op
Benchmark_txn_1-4                   	 2956884	       406.0 ns/op	   2463115 objects/sec	     432 B/op	       7 allocs/op
Benchmark_txn_10-4                  	 7482190	       160.4 ns/op	   6233016 objects/sec	     152 B/op	       2 allocs/op
Benchmark_txn_100-4                 	 7088797	       178.3 ns/op	   5610081 objects/sec	     222 B/op	       2 allocs/op
Benchmark_txn_1000-4                	 7421210	       161.5 ns/op	   6192307 objects/sec	     215 B/op	       2 allocs/op
Benchmark_txn_10000-4               	 5327844	       226.9 ns/op	   4408034 objects/sec	     237 B/op	       2 allocs/op
Benchmark_txn_100000-4              	 3589662	       293.8 ns/op	   3404102 objects/sec	     337 B/op	       2 allocs/op
Benchmark_txn_delete_1-4            	 3280782	       358.7 ns/op	   2787867 objects/sec	     840 B/op	       6 allocs/op
Benchmark_txn_delete_10-4           	 8282569	       141.3 ns/op	   7075411 objects/sec	     131 B/op	       1 allocs/op
Benchmark_txn_delete_100-4          	10238266	       112.2 ns/op	   8914598 objects/sec	      60 B/op	       1 allocs/op
Benchmark_txn_delete_1000-4         	11754006	       101.7 ns/op	   9837163 objects/sec	      26 B/op	       1 allocs/op
Benchmark_txn_delete_10000-4        	10081053	       117.5 ns/op	   8510165 objects/sec	      25 B/op	       1 allocs/op
Benchmark_txn_delete_100000-4       	 8175336	       133.1 ns/op	   7510743 objects/sec	      26 B/op	       1 allocs/op
Benchmark_Get-4                     	   38250	     31246 ns/op	  32004327 objects/sec	       0 B/op	       0 allocs/op
Benchmark_Iterate-4                 	  163138	      7274 ns/op	 137483883 objects/sec	      80 B/op	       3 allocs/op
Benchmark_Hashmap_Insert-4          	   15556	     77192 ns/op	  12954696 objects/sec	   86566 B/op	      64 allocs/op
Benchmark_Hashmap_Get_Uint64-4      	  145688	      8159 ns/op	 122568827 objects/sec	       0 B/op	       0 allocs/op
Benchmark_Hashmap_Get_Bytes-4       	  146608	      8172 ns/op	 122365940 objects/sec	       0 B/op	       0 allocs/op
Benchmark_Uint64Map_Random-4        	    1406	    869112 ns/op	   1150601 items/sec	 2683656 B/op	    9032 allocs/op
Benchmark_Uint64Map_Sequential-4    	    1544	    811176 ns/op	   1232779 items/sec	 2476392 B/op	    9749 allocs/op
PASS
ok  	github.com/cilium/statedb/part	32.488s
PASS
ok  	github.com/cilium/statedb/reconciler	0.005s
?   	github.com/cilium/statedb/reconciler/benchmark	[no test files]
?   	github.com/cilium/statedb/reconciler/example	[no test files]
go run ./reconciler/benchmark -quiet
1000000 objects reconciled in 2.84 seconds (batch size 1000)
Throughput 352675.61 objects per second
Allocated 6011388 objects, 393426kB bytes, 512832kB bytes still in use

@joamaki joamaki merged commit 89f2ff2 into main May 9, 2024
1 check passed
@joamaki joamaki deleted the pr/joamaki/drop-out-of-sync-metric branch May 9, 2024 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant