vladimir56 / arduino-tvout

Automatically exported from code.google.com/p/arduino-tvout
0 stars 0 forks source link

Performance problem with example #59

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The example in

http://code.google.com/p/arduino-tvout/source/browse/TVout/examples/DemoPAL/Demo
PAL.pde

contains a serious performance issue, which shouldn't really be in example 
code, as it can spread to wider usage from there. The issue is with lines 21, 
31, 32 and 41. The lines use loop which has function call as upper limit. This 
causes the function being called on every loop run, instead of using a variable 
to set the limit with the function and comparing that variable.

Demo code can be found as attachment. With that code the results from the 
"Serial.println" were 196 vs 4.

Thanks to eripaha for testing and test-code :)

Original issue reported on code.google.com by kipenros...@gmail.com on 29 Dec 2012 at 11:51

Attachments: