From 76db7d1a62405c9700bd76a93a1601ef3564cd49 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Sat, 22 Jun 2013 09:40:00 +0100 Subject: [PATCH] add benchmarking --- labels_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/labels_test.go b/labels_test.go index fc77f685..27aab751 100644 --- a/labels_test.go +++ b/labels_test.go @@ -98,3 +98,11 @@ func BenchmarkCompareLabels(b *testing.B) { CompareDomainName("www.example.com", "aa.example.com") } } + +func BenchmarkIsSubDomain(b *testing.B) { + for i := 0; i < b.N; i++ { + IsSubDomain("www.example.com", "aa.example.com") + IsSubDomain("example.com", "aa.example.com") + IsSubDomain("miek.nl", "aa.example.com") + } +}