dice icon indicating copy to clipboard operation
dice copied to clipboard

`BenchmarkEvalMSET` benchmark test behaviour is inconsistent

Open AshwinKul28 opened this issue 1 year ago • 5 comments

How to reproduce?


$ cd core
$ /core go test -bench=. -test.benchmem 
     | 2024/08/22 00:33:48 possible cross protocol scripting attack detected. dropping the request.
     | rand seed: 1724267028521704000Queue size : 3
     | goos: darwin
     | goarch: arm64
     | pkg: github.com/dicedb/dice/core
     | BenchmarkAOFWithExat-10                                               271           4498089 ns/op              32 B/op          1 allocs/op
     | BenchmarkLargeByteArray1-10                                      1000000000               0.005893 ns/op        0 B/op          0 allocs/op
     | BenchmarkLargeByteArray2-10                                             1        5055459959 ns/op         2159744 B/op      32003 allocs/op

The test suite forever halts at this point. There's an issue in the BenchmarkEvalMSET (If you comment this particular test whole suite runs perfectly fine) Get the debug logs while benchmarking - GODEBUG=gctrace=1 go test -bench=. -test.benchmem

Probable issue:

It seems in each iteration, the store and required values are not getting initialized causing blockage

AshwinKul28 avatar Aug 21 '24 19:08 AshwinKul28

Hi is it okay if I give this a try?

sbshah97 avatar Aug 21 '24 20:08 sbshah97

Sure @sbshah97 Thanks for picking it up!

@JyotinderSingh please assign it to him.

AshwinKul28 avatar Aug 22 '24 03:08 AshwinKul28

Hi is it okay if I give this a try?

Assigned

JyotinderSingh avatar Aug 22 '24 03:08 JyotinderSingh

Hi I'm going to be looking at this on Tuesday. Slightly caught up on the weekend.

sbshah97 avatar Aug 25 '24 12:08 sbshah97

Running tool: /opt/homebrew/bin/go test -benchmem -run=^$ -bench ^BenchmarkEvalMSET$ github.com/dicedb/dice/core

goos: darwin
goarch: arm64
pkg: github.com/dicedb/dice/core
BenchmarkEvalMSET-10    	   50248	     22360 ns/op	  328741 B/op	      24 allocs/op
PASS
ok  	github.com/dicedb/dice/core	1.615s

Fixed this and tested on local running only the test. Earlier it was not running, runs now based on the above hints. Sending MR now.

sbshah97 avatar Aug 28 '24 23:08 sbshah97