From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.34) id 1BPmm7-0004Xf-Uv for qemu-devel@nongnu.org; Mon, 17 May 2004 14:23:44 -0400 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BPlFR-0001MN-Mp for qemu-devel@nongnu.org; Mon, 17 May 2004 12:46:25 -0400 Received: from [195.9.147.9] (helo=dionis.simtreas.ru) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BPkqm-00062k-DI for qemu-devel@nongnu.org; Mon, 17 May 2004 12:20:25 -0400 Received: from simtreas.ru (IDENT:1000@dzo.ufk.ufk68.minfin.ru [10.68.0.2]) by dionis.simtreas.ru (8.9.3/8.9.3) with ESMTP id UAA31760 for ; Mon, 17 May 2004 20:20:14 +0400 Message-ID: <40A8E6C4.6050105@simtreas.ru> Date: Mon, 17 May 2004 20:22:28 +0400 From: "Vladimir N. Oleynik" MIME-Version: 1.0 References: <200405170918.i4H9I4OR001702@treas.simtreas.ru> In-Reply-To: <200405170918.i4H9I4OR001702@treas.simtreas.ru> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Speed up hack Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi. I generate little speed up hack: 1) new TICKS_BEFORE_POLL constant from make cpu loop before call poll(). 2) call DMA_run() if sb16 or floppy present 3) also, for extreme overclocker: if change MAX_FD from 2 to 1, you can make very little speed up also ;-) --- vl.c~ 2004-05-17 20:15:26.000000000 +0400 +++ vl.c 2004-05-17 19:52:44.000000000 +0400 @@ -1634,6 +1634,8 @@ } } +#define TICKS_BEFORE_POLL 100 + int main_loop(void) { #ifndef _WIN32 @@ -1641,6 +1643,7 @@ IOHandlerRecord *ioh, *ioh_next; uint8_t buf[4096]; int n, max_size; + int tick_before_poll=TICKS_BEFORE_POLL; #endif int ret, timeout; CPUState *env = global_env; @@ -1670,6 +1673,11 @@ Sleep(timeout); #else + if(tick_before_poll!=0 && timeout==0) { + tick_before_poll--; + goto ltick_before_poll; + } + tick_before_poll=TICKS_BEFORE_POLL; /* poll any events */ /* XXX: separate device handlers from system ones */ pf = ufds; @@ -1741,6 +1749,7 @@ } #endif + ltick_before_poll: #endif if (vm_running) { @@ -1750,10 +1759,18 @@ if (audio_enabled) { /* XXX: add explicit timer */ SB16_run(); - } + DMA_run(); + } else { + int i; - /* run dma transfers, if any */ - DMA_run(); + /* run dma transfers, if any */ + for(i = 0; i < MAX_FD; i++) { + if(fd_table[i]) { + DMA_run(); + break; + } + } + } } /* real time timers */ --w vodz