Optimizing the pipeline on my Z80 emulator
Hello! I've come to ask you all a question about optimization of lambda expressions. Currently, my pipeline looks like this:
This is nice because it's very reusable, but, lambda indirection to convert the
LD_R_R(C, B)
into an anonymous call takes time. In this case, it seems like lambdas are pretty slow. How should I go about optimizing this while still keeping it reusable?6 Replies
you would need to write a separate method with a separate switch statement for all of the cases in
instructionTable
that calls LD_R_R(C, B);
etc. directlywhat, so like
no, like:
i do not think it is that much more onerous to write than
hmmm yeah i guess
only thing is id like to separate the switch blocks out for each "table"
should i just
like move each switch out to another method
yes that would be fine i think
mk
just really trying to optimize it
while keeping it readable
ive seen some horribly unreadable emulators
but its fast
and some emulators that are all pretty but eat 20% of your cpu trying to emulate a 4MHz z80