From: Alviro Iskandar Setiawan <alviro.iskandar@gnuweeb.org>
To: Ahmad Gani <reyuki@gnuweeb.org>
Cc: Ammar Faizi <ammarfaizi2@gnuweeb.org>,
"GNU/Weeb Mailing List" <gwml@vger.gnuweeb.org>
Subject: Re: [PATCH gwproxy v10 2/2] gwproxy: refactor code base to add experimental raw DNS backend
Date: Fri, 12 Sep 2025 21:39:36 +0700 [thread overview]
Message-ID: <CAOG64qOhwW8LJ-cqLpyywakTna8Qzq=8aUp+FWT4zF729AoGLw@mail.gmail.com> (raw)
In-Reply-To: <CAADvAgpJR3orQG-C4f7Q28ZKAWTUNQGwMYa+WiaJU2QRh_cf_w@mail.gmail.com>
On Fri, Sep 12, 2025 at 5:37 PM Ahmad Gani wrote:
> In this case, would it be better to allocate both sess_map and stack.arr
> in a single block, so we only call realloc once?
Why would it be better?
I don't think it's worth adding more complexity around it just to get
a non noticeable performance gain, unless you have the numbers?
It'll complicate the reallocation much, as you have to memmove()
around the values yourself. In fact, realloc() may return the same
pointer if it internally doesn't need to expand, or may even use
mremap() in case the memory was directly allocated via mmap() to
expand it without the need to call memmove().
--
Software Engineer & ITPM Officer
Alviro Iskandar Setiawan
+1 908 777 0074
next prev parent reply other threads:[~2025-09-12 14:39 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-10 10:43 [PATCH gwproxy v10 0/2] Initial work on integration of DNS parser lib in gwproxy Ahmad Gani
2025-09-10 10:43 ` [PATCH gwproxy v10 1/2] dnsparser: Add dns parser code Ahmad Gani
2025-09-10 10:43 ` [PATCH gwproxy v10 2/2] gwproxy: refactor code base to add experimental raw DNS backend Ahmad Gani
2025-09-11 10:11 ` Alviro Iskandar Setiawan
2025-09-12 10:37 ` Ahmad Gani
2025-09-12 14:39 ` Alviro Iskandar Setiawan [this message]
2025-09-12 15:49 ` Ammar Faizi
2025-09-12 15:52 ` Ahmad Gani
2025-09-12 16:42 ` Alviro Iskandar Setiawan
2025-09-12 17:00 ` Alviro Iskandar Setiawan
2025-09-14 4:31 ` Ahmad Gani
2025-09-12 17:36 ` Ammar Faizi
2025-09-14 4:34 ` Ahmad Gani
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAOG64qOhwW8LJ-cqLpyywakTna8Qzq=8aUp+FWT4zF729AoGLw@mail.gmail.com' \
--to=alviro.iskandar@gnuweeb.org \
--cc=ammarfaizi2@gnuweeb.org \
--cc=gwml@vger.gnuweeb.org \
--cc=reyuki@gnuweeb.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox