From: "David Arroyo" <droyo@aqwari.net>
To: 9front@9front.org
Subject: Re: [9front] Speeding up snoopy(8)
Date: Thu, 20 Oct 2022 11:55:45 -0400 [thread overview]
Message-ID: <85db2d6b-e60a-4236-9a2c-5b0b77ef99f6@app.fastmail.com> (raw)
In-Reply-To: <EB26D312F5D9872A709C0C1BAA0C3A00@aqwari.net>
On Tue, Oct 18, 2022, at 00:57, droyo@aqwari.net wrote:
> total: 1150
> TEXT 00200000
> ms % sym
> 360 31.3 pread
> 230 20.0 pwrite
> 120 10.4 nsec
> 110 9.5 _filterpkt
> 70 6.0 tracepkt
> 60 5.2 p_filter
> 60 5.2 defaultframer
> 50 4.3 p_filter
> 40 3.4 be2vlong
> 20 1.7 read
> 10 0.8 write
> 10 0.8 newfilter
> 10 0.8 main
> ... snip ...
> More generally, though, I think snoopy could be much faster if it
> read multiple frames per pread() and wrote multiple records per
> pwrite().
I thought about this some more, and I realize that this approach is
premature at best and plain wrong at worst. Snoopy should spend as
much time as possible in pread, because that is when it is
depleting the queue. I should be trying to reduce the time spent
in everything *except* read, and only then should I be worrying
about the per-packet pread overhead.
Reading multiple packets at a time would, however, reduce the number
of nsec() calls.
I will experiment with putting the pwrite in a separate thread, and
look for small performance improvements in the other functions. I
am not sure why nsec() time is so high, but I think that's a function
that could perform very differently on real vs virtual hardware, so
I'm hesitant to try to improve it until I get 9front running on a
real machine.
David
next prev parent reply other threads:[~2022-10-20 15:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-18 4:57 droyo
2022-10-20 15:55 ` David Arroyo [this message]
2022-10-20 16:03 ` Sigrid Solveig Haflínudóttir
2022-10-21 15:38 ` David Arroyo
2022-10-21 16:04 ` ori
2022-10-21 16:54 ` David Arroyo
2022-10-21 17:10 ` ori
2022-10-21 17:40 ` Lyndon Nerenberg (VE7TFX/VE6BBM)
2022-10-21 18:52 ` ori
2022-10-21 19:23 ` ori
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=85db2d6b-e60a-4236-9a2c-5b0b77ef99f6@app.fastmail.com \
--to=droyo@aqwari.net \
--cc=9front@9front.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;
as well as URLs for NNTP newsgroup(s).