comp.lang.ada
 help / color / mirror / Atom feed
* Interesting performance quirk.
@ 2008-10-26  0:57 Peter C. Chapin
  2008-10-26  2:15 ` Jeffrey Creem
                   ` (3 more replies)
  0 siblings, 4 replies; 28+ messages in thread
From: Peter C. Chapin @ 2008-10-26  0:57 UTC (permalink / raw)


I'm working on a cryptographic library in Ada (it's a hobby project). In
addition to unit tests I also plan to provide some benchmark programs
since the performance of encryption and related algorithms is often of
interest. My library is in it infancy right now but I do have (what I
believe to be) a working implementation of Blowfish. So for fun I wrote
a simple benchmark program to exercise my Blowfish implementation.

My program encrypts a 1 MB array repeatedly and then decrypts it
repeatedly. Aside from using -O2 I'm not doing anything fancy with
compiler options nor have I made any particular effort to hand optimize
the code... at least not yet ("make it right before you make it fast").

Now the interesting part. My main development system is a Windows XP
laptop. On this system my "optimized" Blowfish benchmark encrypts or
decrypts at about 11 MB/s (curiously decryption is a little faster than
encryption, which seems odd). It also happens that I have OpenSUSE 10.2
Linux running on the same box in a VMware virtual machine. In that
environment my benchmark encrypts or decrypts at fully 27 MB/s. It's
over twice as fast! I'm using GNAT GPL 2008 in both cases with the same
compiler options and exactly the same source code. I'm even using the
same basic hardware although, as I said, one of my systems---the faster
one---is a virtual machine.

Should I be surprised at this performance difference? I wasn't expecting
it. Note that I'm using Ada.Calendar.Clock to track execution time. At
first I wondered if the virtual machine's notion of time was distorted
in some way but, no... the program is definitely faster in the VM (it
runs long enough so that the difference is speed is easily perceptible
by a human).

I don't really have a question or a problem with any of this, but I
found it curious and I thought I'd post in case someone had some useful
insight into what might be going on.

Peter



^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2008-11-17 11:51 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-26  0:57 Interesting performance quirk Peter C. Chapin
2008-10-26  2:15 ` Jeffrey Creem
2008-10-26 11:16   ` Peter C. Chapin
2008-10-26  4:57 ` tmoran
2008-10-26 11:11   ` Peter C. Chapin
2008-10-28  8:49     ` Martin
2008-10-28 11:35       ` Peter C. Chapin
2008-10-28 14:21         ` Robert A Duff
2008-10-29  1:42           ` Peter C. Chapin
2008-10-28 18:27         ` Jeffrey R. Carter
2008-10-29  1:39           ` Peter C. Chapin
2008-10-29  5:27             ` Jeffrey R. Carter
2008-10-28 23:22         ` Ludovic Brenta
2008-10-29  8:42           ` oenone
2008-10-29  9:59           ` Peter C. Chapin
2008-10-29 10:19             ` Martin
2008-11-17  6:31             ` David Thompson
2008-11-17 11:51               ` Peter C. Chapin
2008-10-29  9:54         ` Alex R. Mosteo
2008-10-30 11:16           ` Peter C. Chapin
2008-10-29 16:12         ` Colin Paul Gloster
2008-10-30 11:23           ` Peter C. Chapin
2008-10-31 13:41             ` Colin Paul Gloster
2008-11-01 15:41               ` Gene
2008-10-29 20:18 ` Florian Weimer
2008-10-30 11:15   ` Peter C. Chapin
2008-11-07  0:44 ` Randy Brukardt
2008-11-07  1:23   ` Peter C. Chapin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox