>"What methods do you ever use to optimize the programs?">>We're developing a graphics chip emulator in C++, but it's very slow>for big scenes.

IMO you should avoid virtual methods and sophisticated class
libraries, including most of the C++ standard classes. Universal class
libraries tend to offer many features, which require much indirection
and many runtime checks and decisions.

And the most important optimization, regardless of any language, is
the appropriate choice of the algorithms. Have you ever determined or
measured the order of your algorithms O(?), depending on the size of
the graphics?

Another idea: avoid mixing data types. Some compilers report hints or
warnings, about "mixing signed and unsigned data types". Such mixes
can require the implicit conversion of sub-expressions to the next
larger (common) data type, what can consume some time when e.g. int's
are converted to int64. Also avoid using 16 bit data types in 32 bit
x86 code, which require prefix bytes (opsize) and possibly also result
in implicit type conversions. The "native" data types in such an
environment have 8 or 32 bits.