]> git.ipfire.org Git - thirdparty/pdns.git/commit
dnsdist: Make inserting to the in-memory rings a bit faster 16315/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 17 Oct 2025 10:33:21 +0000 (12:33 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 20 Oct 2025 09:10:05 +0000 (11:10 +0200)
commit73d212e6da605c357453d10a93306ec961f47e8a
treefc437e6c79da67c590693ef3cb149b716aa1075e
parent19d000291f91681a14718118581841bac32d4570
dnsdist: Make inserting to the in-memory rings a bit faster

This commit moves the allocation and copy of the DNS name before
taking the lock, reducing contention. In completely unrealistic
benchmarks this makes the insertion ~10% faster.
Ideally I would rather move the existing `DNSName` instead of allocating
a new one, as we are usually done with it by the point we insert
into the rings, but this involves a lot of changes so let's start
with this.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit 868ec90eacc2fc10f923bbfc333cb5b802fc9fbb)
pdns/dnsdistdist/dnsdist-rings.hh