qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH ] test-coroutine: test cost introduced by corout


From: Ming Lei
Subject: Re: [Qemu-devel] [PATCH ] test-coroutine: test cost introduced by coroutine
Date: Wed, 13 Aug 2014 18:07:12 +0800

On Mon, Aug 11, 2014 at 7:59 PM, Ming Lei <address@hidden> wrote:
> This test uses getppid() syscall to simulate single operation
> run inside coroutine, and compare how many operations done per
> second between using coroutine and not using coroutine to
> evalute cost introduced by running operation via coroutine.
>
> Paolo introduced 'baseline test' for computing the cost
> of coroutine operations, and it may be not enough since coroutine
> switches stack for running task and this cost won't be considered
> at all, and in reality most of actual corotine cases can't avoid
> stack use at all. So this patch uses getppid() syscall to simulte
> operation running from coroutine:
>
>         - syscall and related stack operations can't be optimized by compiler
>         - push to/pop from user space stack introduced by calling syscall,
>         such as for save/restore context
>     - also it isn't unusual to call syscall from coroutine
>
> For example, here are the results on my machine when treating 1
> getppid() as one operation:
>
>         - Run operation 60000000 iterations(1 getppid() per operation) 
> without using
>         coroutine: 3.517642 s, 17056K operations/s
>         - Run operation 60000000 iterations(1 getppid() per operation) using
>         coroutine: 11.157434 s, 5377K operations/s
>         - Coroutine introduced cost: 68%
>
> If running 30 getppid() in one operation:
>
>         - Run operation 60000000 iterations(30 getppid() per operation) 
> without using
>         coroutine: 3.264977 s, 612K operations/s
>         - Run operation 60000000 iterations(30 getppid() per operation) using
>         coroutine: 3.733169 s, 535K operations/s
>         - Coroutine introduced cost: %12
>
> So in some situations, the cost introduced by coroutine isn't too small
> to be ignored.

Please ignore this one, and I have better and simper patch to figure out
coroutine cost.

Thanks,



reply via email to

[Prev in Thread] Current Thread [Next in Thread]