Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
You'd think this would be faster, but NO!!!!!! [Resolved]
#8
FWIW I don't really think this is an optimization thing, unless Pete turned the "Compile program with C++ optimization flag" thing on then the code isn't being optimized. Beyond that, both the SCREEN() and ASC() functions live in a separate `.o` file from the main code so typically this means they would never be inlined since the linker doesn't normally do that (and we don't tell it to do link-time-optimization).

The one thing I was wondering is whether `h` was a SINGLE rather than integer value, then there would be a floating point conversion going on. Still, I would expect calling `func_screen()` to be slower than the floating point conversion.

The other consideration is whether the event checking around `h = SCREEN(j,  k + i)` adds too much overhead, simply because `func_screen()` and `func_asc()` do almost nothing in these cases and thus should be very fast. If you have a chance you might try putting `$CHECKING:OFF` around it and see if the speed discrepancy is still there.
Reply


Messages In This Thread
RE: You'd think this would be faster, but NO!!!!!! - by DSMan195276 - 10-14-2022, 04:41 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Faster addition in string math. Now with multiplication! Pete 23 4,096 08-22-2022, 02:26 AM
Last Post: Pete

Forum Jump:


Users browsing this thread: 3 Guest(s)