Re: Cracking DES with C++ is faster than Java?
From: Jerry Coffin (jcoffin_at_taeus.com)
Date: 04/30/04
- Next message: KrOoSh: "Re: A programme to receive the HTML code from a URL"
- Previous message: Jerry Coffin: "Re: Cracking DES with C++ is faster than Java?"
- In reply to: Andrew Swallow: "Re: Cracking DES with C++ is faster than Java?"
- Next in thread: Andrew Swallow: "Re: Cracking DES with C++ is faster than Java?"
- Reply: Andrew Swallow: "Re: Cracking DES with C++ is faster than Java?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 29 Apr 2004 21:13:46 -0700
"Andrew Swallow" <am.swallow@eatspam.btinternet.com> wrote in message news:<c6o7e4$pmn$1@sparta.btinternet.com>...
[ ... ]
> Computers can access fixed locations in memory
> faster that relative locations.
That's not necessarily true. In theory, it takes more work to
generate the absolute address from a relative address, but in fact
nearly all reasonably current computers have hardware dedicated to the
task.
With most modern computers, a cache miss causes a MUCH larger delay
than figuring an effective address.
> Recursion requires
> local variables to be stored on the stack, i.e. to
> be accessed using relative locations. Data structures
> on the heap are even more complicated to access.
Not so -- allocating and freeing data can be expensive, but at least
in C and C++, when you allocate memory on the heap/free store you get
the (absolute) address of the memory allocated. Once you have that,
the access is relatively direct. By contrast, access to the stack is
essentially always done relative to some register.
As noted above, however, this rarely means much. Accessing data on
the stack IS usually quite fast, but that's primarily because the page
at the top of the stack will nearly always be in the cache.
> Dynamic storage is very bad, you can see the computer
> stop for several thousand million clock cycles whilst the
> garbage collector tries to find some more memory.
Only, for starters, when you actually use a garbage collector. Even
then, techniques to reduce waits during a collection cycle have been
well known for quite some time. I realize that many JVMs (for one
example) use GC that dates back to roughly the Lisp 1.5 era, but that
doesn't mean nothing better is known. Generataional scavenging,
incremental GC, etc., have been around for some time and can't be
summarily dismissed even for hard real-time systems.
--
Later,
Jerry.
The universe is a figment of its own imagination.
- Next message: KrOoSh: "Re: A programme to receive the HTML code from a URL"
- Previous message: Jerry Coffin: "Re: Cracking DES with C++ is faster than Java?"
- In reply to: Andrew Swallow: "Re: Cracking DES with C++ is faster than Java?"
- Next in thread: Andrew Swallow: "Re: Cracking DES with C++ is faster than Java?"
- Reply: Andrew Swallow: "Re: Cracking DES with C++ is faster than Java?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|