]> granicus.if.org Git - pdns/commitdiff
Add speedtest for DNSName, QType rings
authorPieter Lexis <pieter.lexis@powerdns.com>
Wed, 20 Feb 2019 12:29:19 +0000 (13:29 +0100)
committerPieter Lexis <pieter.lexis@powerdns.com>
Wed, 20 Feb 2019 16:00:19 +0000 (17:00 +0100)
'StatRing test with DNSName and QType to string' 0.11 seconds: 3437241.4 runs/s, 0.29 usec/run
'StatRing test with DNSName and QType' 0.11 seconds: 12516308.0 runs/s, 0.08 usec/run

pdns/speedtest.cc

index 1f64c96067b37806ec0c40ce8c6dda21c27fe246..9099d3d0ac27d5f638bc2e21782f56982191dc89 100644 (file)
@@ -807,6 +807,20 @@ struct StatRingDNSNameQTypeToStringTest
   QType d_type;
 };
 
+struct StatRingDNSNameQTypeTest
+{
+  explicit StatRingDNSNameQTypeTest(const DNSName &name, const QType type) : d_name(name), d_type(type) {}
+
+  string getName() const { return "StatRing test with DNSName and QType"; }
+
+  void operator()() const {
+    S.ringAccount("testring", d_name, d_type);
+  };
+
+  DNSName d_name;
+  QType d_type;
+};
+
 
 
 int main(int argc, char** argv)
@@ -897,6 +911,9 @@ try
 
   S.declareRing("testring", "Just some ring where we'll account things");
   doRun(StatRingDNSNameQTypeToStringTest(DNSName("example.com"), QType(1)));
+
+  S.declareDNSNameQTypeRing("testring", "Just some ring where we'll account things");
+  doRun(StatRingDNSNameQTypeTest(DNSName("example.com"), QType(1)));
 #endif
 
   cerr<<"Total runs: " << g_totalRuns<<endl;