4 ms·
Because the 'neutral pseudocode' was actually valid Go code I just benchmarked it: BenchmarkDedupe1-4 3000000 521 ns/op Ben
by hwj 8y ago
Because the 'neutral pseudocode' was actually valid Go code I just benchmarked it:
BenchmarkDedupe1-4 3000000 521 ns/op
BenchmarkDedupe2-4 5000000 275 ns/op
BenchmarkDedupe3-4 500000 3337 ns/op
BenchmarkAlt-4 1000000 3174 ns/op
Source: https://gitlab.com/hwj/rad https://gitlab.com/hwj/rad
(The 'alt' implementation is my own and maybe not what the author had in mind with 'a searchable data structure to record seen entries'.)
- dan-robertson 8y agoBenchmark times are going to vary quite a lot with size of array and number of unique elements so recording times for one specific size of array doesn’t say much.
- masklinn 8y agoTo actually be useful, the benchmark should provide variations in total sequence size and frequency of duplicates.