Skip to content

Commit 28564b2

Browse files
author
Örjan Persson
committed
Added benchmark for common prefix and suffix
1 parent 71d7f40 commit 28564b2

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

diffmatchpatch/dmp_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,3 +1319,19 @@ func Benchmark_DiffMain(bench *testing.B) {
13191319
dmp.DiffMain(a, b, true)
13201320
}
13211321
}
1322+
1323+
func Benchmark_DiffCommonPrefix(b *testing.B) {
1324+
dmp := New()
1325+
a := "ABCDEFGHIJKLMNOPQRSTUVWXYZÅÄÖ"
1326+
for i := 0; i < b.N; i++ {
1327+
dmp.DiffCommonPrefix(a, a)
1328+
}
1329+
}
1330+
1331+
func Benchmark_DiffCommonSuffix(b *testing.B) {
1332+
dmp := New()
1333+
a := "ABCDEFGHIJKLMNOPQRSTUVWXYZÅÄÖ"
1334+
for i := 0; i < b.N; i++ {
1335+
dmp.DiffCommonSuffix(a, a)
1336+
}
1337+
}

0 commit comments

Comments
 (0)