Mono Tasklet / Co-Routines Overhead

What are the main performance overheads (copying gc / stack ...) of the new Mono Continuations / Tasklet structure?

How does this overhead (performance / coroutine performance) compare with other frameworks like Lua Coroutine and unstable python?

In Mono 2.6, continuation / coroutine support will be added. I built the svn version and used the following code to evaluate its overhead

static void Main() { Console.WriteLine("starting.,.."); for(int i = 0; i < 10000; i++) { MicroThread t1 = new MicroThread(Run1); t1.Start(); } Scheduler.Run(); Console.WriteLine("starting raw loop.,.."); int x = 2; for (int i = 0; i < 10000 * 400; i++ ) { x++; } Console.WriteLine("1finished.,.. " + x.ToString()); Console.ReadLine(); } static void Run1() { for (int y = 0; y < 400; y++) { MicroThread.CurrentThread.Yield(); } } 

Starting the microflow / scheduler took about 1.5-2 seconds, while the raw cycle was almost instantaneous. Although overhead is expected, this seems a bit big.

What are the main performance overheads of the new Mono Continuations / Tasklet? How does this overhead (performance / coroutine performance performance) compare with other frameworks like Lua Coroutine and unmanaged python?

thanks

+4
source share
2 answers

If I'm not mistaken, your code makes over 2 million returns per second, which should be extremely difficult in the same step as contactless python.

Considering that mono, as a rule, executes real application code 10-100 times faster than python, the performance will most likely be very good, unless your code works without real work, which I don’t think is very useful :)

+5
source

Given that there are very few people with experience to answer this, you may have to go to them and ask for a mono-devel list.

You can also look at the archives to see the discussion around monoco / tasklet when it was introduced:

http://lists.ximian.com/pipermail/mono-devel-list/2009-April/031680.html

+3
source

All Articles