]> git.ipfire.org Git - thirdparty/pdns.git/commit
dnsdist: Make inserting to the in-memory rings a bit faster 16285/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 17 Oct 2025 10:33:21 +0000 (12:33 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 17 Oct 2025 10:33:21 +0000 (12:33 +0200)
commit868ec90eacc2fc10f923bbfc333cb5b802fc9fbb
tree4c2d4547d0a6a5af15c904a706647993093850ee
parent0c511faccb4aac5d6db8f2a26ad467bb259601b1
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>
pdns/dnsdistdist/dnsdist-rings.hh