470,848 Members | 1,887 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,848 developers. It's quick & easy.

Writing CPU Emulator in C++ language

I did a lot of research on the internet. There are many discussions.
The discussion states that writing class with pointer to member function in
C++ language is the wrong language. Some say to use C language or assembly
language if programmers want high performance for CPU emulator. They need
to make a choice to use switch table or pointer to function table. The
pointer to function table is the fastest performance, but switch table is
little slower.
If I want to use C++ language to write CPU emulator, I am told to use
namespace with data member and function member. The traditional pointer to
function outside of class is faster than pointer to member function inside
class. The object oriental programming is less use if you use namespace.
If I truly want to use class instead of namespace, the option is to use
switch table with member function list inside class.
Can you please advise me which namespace or class is chosen? I did find
out that pointer to member function is rarely used.
Jun 27 '08 #1
2 2942
Immortal Nephi wrote:
The pointer to function table is the fastest performance, but switch table is
little slower.
Source? I would think it's the other way round.
Jun 27 '08 #2
On Jun 16, 2:32 pm, Matthias Buelow <m...@incubus.dewrote:
Immortal Nephi wrote:
The pointer to function table is the fastest performance,
but switch table is little slower.
Source? I would think it's the other way round.
I would think it would depend on the compiler, the degree of
optimization requested, and the underlying architecture.

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Jun 27 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Mark Irvine | last post: by
15 posts views Thread by Douglas Garstang | last post: by
2 posts views Thread by Stuart Ferguson | last post: by
4 posts views Thread by mac | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.