llvm-mos / llvm-mos-sdk

SDK for developing with the llvm-mos compiler
https://www.llvm-mos.org
Other
266 stars 53 forks source link

Improve NMI performance for multi_vram_buffer ops #212

Closed cogwheel closed 11 months ago

cogwheel commented 11 months ago

For a single 3-byte horizontal operation this saved 14 cycles from flush_vram_update2

With two multi_vram_buffer_vert operations totaling 36 tiles and 10 one_vram_buffer this saved 44 cycles. This looks like it works out to ~12 cycles per multi and 2 cycles per single.

cogwheel commented 11 months ago

Hmm... I was under the impression that the function just changes the address of the vram buffer and that the existing APIs would still be used (though I should've updated that comment).

But yes, if a project has custom code to insert operations into the buffer, then this will be a breaking change.

I'll see if I can keep some of the performance gains without the format change.

cogwheel commented 11 months ago

I guess most of the gains were elsewhere; going back to the old format only cost 2 cycles for the multi_vram_buffer ops.