Re: [Rubydotnet-developer] Performance
Status: Alpha
Brought to you by:
thomas
From: Tim S. <ti...@ih...> - 2004-10-29 11:11:32
|
On Fri, Oct 29, 2004 at 10:36:45PM +1300, Tim Sutherland wrote: > On Fri, Oct 29, 2004 at 09:30:59PM +1300, Tim Sutherland wrote: > [...] > > The first set of numbers is from my head and may be a wrong: > > my bridge was getting ~500 calls per second, the other two were a bit > > faster, maybe 800 or 1500. > [...] > > And now for the nice numbers... > > > > Using Hashtable with Equals: ~86,000 calls per second. > > Using GCHandle: ~58,000 calls per second. > [...] > > I think Thomas' was around 5000 or so calls per second. It was > definitely the best (because of the other bridges' Hashtable problem). > But even that bridge can probably be made 10x faster or more pretty > easily, as shown by my second set of results. I checked my actual numbers... I ran each program with whatever number of iterations made it run in around 10 seconds. Then I repeated with twice as many iterations, expecting around 20 seconds. (This was not always the case.) My original bridge was getting between 445 and 888 calls per second. (It varied a lot depending on the number of iterations, for gc reasons?) Adding in ``lazy DotNet::Instance initialisation'' actually made it slower, between 258 and 409 calls per second. This surprised me since the things we're avoiding initialising are never actually used by the benchmark. I think it's changing the gc somehow... When I added some debugging to print out around 20,000 lines, the bridge was about twice as fast. Again, gc reasons I think, with the linearity of the hashtable lookups. Changing the Hashtable to use Equals instead of == resulted in 21,000 calls per second. Adding in lazyness gave 47,000. Using GCHandles, but not lazy: 26,000 calls per second Using GCHandle, and also lazy: 60,000 calls per second (So GCHandles are actually faster, contrary to my previous post.) [Hopefully I won't have to followup quickly to this post!] |