perftest:ndr_pack: spin in do_nothing for a while
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 3 Jan 2024 12:54:29 +0000 (01:54 +1300)
committerJule Anger <janger@samba.org>
Mon, 12 Feb 2024 10:53:13 +0000 (10:53 +0000)
The idea was to get a less jittery idea of the underlying noise, but
ut is still almost instant. This I suppose is useful in indicating
that this much of the test has very little overhead.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15574
(cherry picked from commit 93e6ea4cff2cb6bd084db27139addeea06945ea5)

source4/dsdb/tests/python/ndr_pack_performance.py

index ed1216e6392b7f8ff60718facf9c715a619bbb48..45c1816df39be33aa313db6020f44dab4881589e 100644 (file)
@@ -132,9 +132,10 @@ class UserTests(samba.tests.TestCase):
     def get_blob(self, sddl):
         return ndr_pack(self.get_desc(sddl))
 
-    def test_00_00_do_nothing(self):
+    def test_00_00_do_nothing(self, cycles=10000):
         # this gives us an idea of the overhead
-        pass
+        for i in range(SCALE * cycles):
+            pass
 
     def _test_pack(self, unpacked, cycles=10000):
         pack = unpacked.__ndr_pack__