View Single Post
Unread June 12th, 2019, 11:25 AM   #64
Lifetime Supporting Member + Moderator

JesperMP is offline
JesperMP's Avatar
Join Date: Feb 2003
Location: Copenhagen.
Posts: 14,002
LD's tests done with a Siemens S7-1512SP (optimized block access)
1: //indexed multiply with non-zero data - 434ms
2: //non indexed multiply with non-zero data - 557ms
3: //some trig functions - 498ms
4: //non indexed multiply with non-zero data, more calcs, for loop smaller - 455ms
5: //non indexed divide with non-zero data - 540ms
6: //non indexed multiply with zero data - 320ms
7: //Boolean logic - 54ms
8: //Bitwise operation - 51ms
9: //bubble sort - 1250ms

Again, due to the memory requirements I had to reduce the array sizes and extrapolate the results.

edit: I think that Kamenges is right, that in test 3 (and possibly some of the other tests) the TIA compiler detects that the variable doesnt get changed, so that it is a de-facto constant, and thus optimises the code by substituting the calculation by a simple value assignment of the result of the formula.

edit again: That could mean that the tests should be reviewed and possibly changed to avoid that from happening. Otherwise the test results are skewed.
See my profile interests for Q&A

Last edited by JesperMP; June 12th, 2019 at 11:31 AM.
  Reply With Quote