Errors, bugs, questions - page 2315

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Why is by_ref slower than by_val?
Where does it follow from?
If the code is the same
so does the result (execution time difference):
+12.221:0
+5.099:0
+0.149:0
-13.729:0
+14.531:0
-27.429:0
+26.405:0
-0.839:0
+5.400:0
-4.882:0
alternating (+\-) within insignificant limits
Where does it come from?
I wanted to put a grade on the KB and it didn't work. And judging by the fact that recent publications have no grades at all, it looks like I'm not the only one with this problem.
Yeah, it's not working.
In my loops ref and val have the same code (comparison is more or less correct), while yours is different
Yes, different. But the question remains valid. Why is val-variant noticeably faster than ref?
Yes, different. But the question remains valid. Why is the val-variant noticeably faster than ref?
Maybe the ref variant is less optimized by the compiler - who knows.
To my mind, both variants should compile nearly the same code or even completely the same code but the compiler handles things differently
Maybe the ref variant is worse optimized by the compiler - who knows.
Seems to me both should compile roughly the same code or even exactly the same, but the compiler thinks differently
The question was actually meant for developers, so that there is a basis for discrepancies in the reasons for discrepancies.
Usually I try to pass everything by reference for speed. And this was justified in some builds. But it seems to me now.
+1. Something seems to be broken. Bild 1881 x64. Win 10. On startup it loads CPU by 20+% (i5 8600k) and RAM by 650-700mb (no increase).
Task manager shows "Not responding" status.
And the other terminal 1881 (not Opening) runs fine.
Added:
Eventually it did boot up. However it took extremely long to boot - that's not normal. Then I closed terminal and opened it again. Opened instantly. Apparently there was some problem with data loading.
The solution was to reinstall the terminal. I also accidentally deleted the folder with all the settings and graphs) I drew everything again, but it works like clockwork now.
This was not necessary. You could simply delete the news.dat file.
maybe the ref variant is worse optimised by the compiler - who knows?
To my mind, both options should compile approximately the same code or even completely the same code, but the compiler counts in a different way
What's the connection between the final code and its execution time?
For example, let's change . .. so that the loops become absolutely identical
The result..:
by_ref took 18354.547 milliseconds: sum=1865600ll
by_val took 18318.319 milliseconds: sum=1861628ll
by_ref took 18416.747 milliseconds: sum=1904488ll
by_val took 18221.978 milliseconds: sum=1907860ll
by_ref took 18301.009 milliseconds: sum=1757988ll
by_val took 18545.258 milliseconds: sum=1949720ll
by_ref took 18373.648 milliseconds: sum=1867160ll
by_val took 17972.432 milliseconds: sum=1760308ll
by_ref took 19426.076 milliseconds: sum=1795564ll
by_val took 19177.485 milliseconds: sum=1826360ll
is about the same... Or do you think that the compiler has created different code in the same loops?
Let me remind you - there was something like this
by_ref took 13889.424 milliseconds: sum=-1000000ll
by_val took 14135.603 milliseconds: sum=-1000000ll
and different code... and there's about the same difference in time, but the code and the functions themselves are exactly the same