Closed lmichaelis closed 1 year ago
My idea for improving performance is mainly to get rid of std::stack
since it has many features not needed for our application. What I've done now is the following (also see 5aed861fe547e40fedd5eb3801191b9323cb60d6):
vm::_m_stack
from std::stack
to a basic arrayvm::_m_stack_ptr
to keep track of the current stack head positionThis yields about 5% better performance in RelWithDebugInfo
builds as per my brief testing. I'm really not sure if this is a worthwhile improvement but it could benefit performance improvements in the future. Right now, this change would drastically increase memory usage (by around 114kB) in exchange for only minor performance gains.
@Try, since OpenGothic is the largest user of phoenix right now, what do you think?
Hi, @lmichaelis !
Looks good to me.
drastically increase memory usage by around 114kB
Game OpenGothic about ~1GB :D 0.1Mb is not something to worry about, on ther side of thing 5% is quite good improvement for runtime
A
std::stack
does not have any relevant performance requirements, so it might be unsuitable for a semi high-performance application like the VM. Replacing it with a wrapper around astd::vector
, for example should improve performance.