From: "Vladimir N. Oleynik" <dzo@simtreas.ru>
To: qemu-devel@nongnu.org, fabrice@bellard.org
Subject: [Qemu-devel] Re: Speed up hack
Date: Tue, 18 May 2004 12:30:52 +0400 [thread overview]
Message-ID: <40A9C9BC.7060204@simtreas.ru> (raw)
In-Reply-To: <200405172346.i4HNkiOR003792@treas.simtreas.ru>
Hi, Fabrice.
> Can you estimate the speed gains ? I am especially interested by the
> poll() overhead.
I changed test/sha1.c for see production
-#define BUFSIZE 4096
+#define BUFSIZE 4096*16
+#define TEST 10
+
+#include <sys/time.h>
+#include <unistd.h>
int
main(int argc, char **argv)
{
SHA1_CTX ctx;
unsigned char hash[20], buf[BUFSIZE];
- int i;
+ int i, tn;
+ struct timeval tv, tv2;
+ int ts, tus;
+ double dt;
+ for(tn = 0; tn < TEST; tn++) {
+ gettimeofday(&tv, NULL);
for(i=0;i<BUFSIZE;i++)
- buf[i] = i;
+ buf[i] = i + tn;
- printf("SHA1=");
+ gettimeofday(&tv2, NULL);
+ ts = tv2.tv_sec - tv.tv_sec;
+ tus = tv2.tv_usec - tv.tv_usec;
+ dt = 1000000.0*ts;
+ dt += tus;
+ dt /= 1000000.0;
+ printf("dt=%.3f SHA1=", dt);
for(i=0;i<20;i++)
printf("%02x", hash[i]);
printf("\n");
+ }
My P4 2.6GHZ give ~ 1 sec per test, my qemu (softmmu) give:
without TICKS_BEFORE_POLL ~ 11.838 sec per test
withc TICKS_BEFORE_POLL=100 ~ 11.756 sec per test
Hmm. very little different :(
I give ~ 0.02 sec per test if set "static inline" for
cpu_get_real_ticks() and qemu_run_timers()
;-)
> For the rest, optimizing DMA_run() would be simpler
> and more efficient.
May be ;-)
--w
vodz
parent reply other threads:[~2004-05-18 8:35 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <200405172346.i4HNkiOR003792@treas.simtreas.ru>]
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=40A9C9BC.7060204@simtreas.ru \
--to=dzo@simtreas.ru \
--cc=fabrice@bellard.org \
--cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.