From 75509644bd5b6f5c596c42c80afff12ff45f3436 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Mon, 13 May 2024 16:07:36 +0200 Subject: [PATCH] wip --- lib/stringsutil/less_natural_timing_test.go | 32 ++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/lib/stringsutil/less_natural_timing_test.go b/lib/stringsutil/less_natural_timing_test.go index bbefe66ca..edb3a6484 100644 --- a/lib/stringsutil/less_natural_timing_test.go +++ b/lib/stringsutil/less_natural_timing_test.go @@ -7,7 +7,37 @@ import ( func BenchmarkLessNatural(b *testing.B) { b.Run("distinct_string_prefixes", func(b *testing.B) { benchmarkLessNatural(b, []string{ - "aaa", "bbb", "ccc", "ddd", "eee", "fff", + "aaa", "bbb", "ccc", "ddd", "eee", "fff", "g", "hh", "kkk", "ooo", "ppppp", "wwww", "zzz", "qqq", + }) + }) + b.Run("distinct_numeric_values", func(b *testing.B) { + benchmarkLessNatural(b, []string{ + "111", "222", "333", "44", "5555", "666", "7", "88", "999", "000", "123", "452", "34", "234", + }) + }) + b.Run("common_string_prefixes_distinct_string_suffixes", func(b *testing.B) { + benchmarkLessNatural(b, []string{ + "XXXaaa", "XXXbbb", "XXXccc", "XXXddd", "XXXeee", "XXXfff", "XXXg", "XXXhh", "XXXkkk", "XXXooo", "XXXppppp", "XXXwwww", "XXXzzz", "XXXqqq", + }) + }) + b.Run("common_string_prefixes_distinct_numeric_suffixes", func(b *testing.B) { + benchmarkLessNatural(b, []string{ + "XXX111", "XXX222", "XXX33", "XXX4", "XXX555", "XXX666", "XXX7", "XXX88", "XXX999", "XXX000", "XXX12345", "XXX3211", "XXX873", "XXX98", + }) + }) + b.Run("common_string_values", func(b *testing.B) { + benchmarkLessNatural(b, []string{ + "XXXXX", "XXXXX", "XXXXX", "XXXXX", "XXXXX", "XXXXX", "XXXXX", "XXXXX", "XXXXX", "XXXXX", "XXXXX", "XXXXX", "XXXXX", "XXXXX", + }) + }) + b.Run("common_numeric_prefixes", func(b *testing.B) { + benchmarkLessNatural(b, []string{ + "111aaa", "111bbb", "111ccc", "111ddd", "111eee", "111fff", "111g", "111hh", "111kkk", "111ooo", "111ppppp", "111wwww", "111zzz", "111qqq", + }) + }) + b.Run("common_numeric_values", func(b *testing.B) { + benchmarkLessNatural(b, []string{ + "11111", "11111", "11111", "11111", "11111", "11111", "11111", "11111", "11111", "11111", "11111", "11111", "11111", "11111", }) }) }