alex-ong / NESTrisOCR

OCR for statistics in NESTris
24 stars 7 forks source link

DIRECT_CAPTURE vs WINDOW_N_SLICE analysis #33

Closed alex-ong closed 4 years ago

alex-ong commented 4 years ago
I've done benchmarks with full runthrough (including the OCR algorithm) DC/WS Strategy Capture field Preview PieceStats WindowSize Avg
WS NAIVE yes yes None 800x700 6.6ms
DC NAIVE yes yes None 800x700 9.28ms
WS NAIVE no yes None 800x700 6.2ms
DC NAIVE no yes None 800x700 5.4ms
WS NAIVE no yes FIELD 800x700 6.4ms
DC NAIVE no yes FIELD 800x700 6.2ms
DC/WS Strategy Capture field Preview PieceStats WindowSize Avg
WS FASTEST yes yes None 800x700 4.8ms
DC FASTEST yes yes None 800x700 4.2ms
WS FASTEST no yes None 800x700 4.2ms
DC FASTEST no yes None 800x700 2.2ms
WS FASTEST no yes FIELD 800x700 4.8ms
DC FASTEST no yes FIELD 800x700 4.2ms

Key takeaways:

But more pertinant is the actual capture performance. image

Notice how it has initting bitblt. I found a small optimization where that cost should actually always be 0. So that would affect the DC/WS values in the tables at the beginning of the post.

Also, performance jumps off a cliff after 1024x768.

alex-ong commented 4 years ago
I did my speedup to remove the initting bitblt: DC/WS Strategy Capture field Preview PieceStats WindowSize Avg
WS FASTEST yes yes FIELD 800x700 4.8ms
DC FASTEST yes yes FIELD 800x700 4.8ms
WS FASTEST no yes FIELD 800x700 4.3ms

However as long as you have CAPTURE_FIELD, WINDOW_N_SLICE is superior. Let's kill DIRECT_CAPTURE.