l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2006 Feb 17 15:01

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] benchmarking (again)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] benchmarking (again)

On Fri, Feb 17, 2006 at 04:16:29PM -0500, Peter Jay Salzman wrote:
> On Fri 17 Feb 06, 12:00 PM, Mark K. Kim <lugod@cbreak.org> said:
> > I think you mean CPU registers?  L1/L2/L3 caches are just buffers
> > between RAM and the CPU registers, and all data allocated in RAM, stack
> > or heap, go through L1 cache at some point.  Programming languages or
> > compilers have no direct memory allocation access of the caches.
> I was under the impression that this is what computer scientists call
> "locality of data" -- if data is used once, it'll be used again soon.  The
> strategy that attempts to exploit locality of data is to hold recent data in
> L1 cache.

Yep.  But the software has little control over what happens at L[123]
cache because L[123] caching is done at hardware-level, behind the
scene.  All RAM read/write goes through the cache, and all recently RAM
read/written data is most likely to be in the L[123] cache, whether it
was a heap read/write operation or a stack read/write operation.  The
compiler, if it knows the caching algorithm of the platform, can try to
take advantage of the caching pattern, but that's pretty much the extent
of the software's control over the L[123] cache.  

> I see what you mean.  Yeah, but the question still remains -- what's going
> on with the user time in java apps, and why does the program run faster in
> Java than C++?  Certainly C++ compilers know how to do all that stuff too.

As Jeff pointed out, Cygwin can be a bit of an oddball.  I'm not sure
what happens if you run `time` on a non-Cygwin program like a JVM.
Also, I'm not sure what JVM considers "system" and "user" time -- if the
whole program gets executed by the JVM as a system driver then "system"
time is what C++ would consider a "user" time.

Try the code under Linux.  It should give more accurate measurements.


Mark K. Kim
AIM: markus kimius
Homepage: http://www.cbreak.org/
Xanga: http://www.xanga.com/vindaci
Cyworld: http://www.cyworld.com/markuskimius
Friendster: http://www.friendster.com/user.php?uid=13046
PGP key fingerprint: 7324 BACA 53AD E504 A76E  5167 6822 94F0 F298 5DCE
PGP key available on the homepage
vox-tech mailing list

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Appahost Applications
For a significant contribution towards our projector, and a generous donation to allow us to continue meeting at the Davis Library.