Test task from Xena Exchange
Task
Write single-thread de-duplicating handler for job(id, timestamp). Jobs ordered by timestamp. Deduplication by job.id in statically configured time window.
Test setup
Benchmark test suite should generate identical load for each tested handler. Configurable deduplication window size, jobs rate borders and duplicate probability. Handler results correctness checks. Handlers resource consumption check. Randomization seed may be passed as RAND_SEED env variable.
Run bench
go test -bench=. -cpu=1 -benchtime=10000x -benchmem
Test uses manual GC invocation after each job processing for most accurate heap usage analyse, so tests make take a while – be patient or decrease benchtime…