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
Ah, well, then it's normal at all.
I also have one canvas on my gif, and it's the panel that eats up the least amount of resources, because I don't have to redraw it as often and catch the moment a new bar comes in.
Great! Everything is flying!
And at low speed, it updates without skipping a beat.Found the right files. It's not clear where, where and when to look at the numbers, but even without that one can see that the canvas is much slower, and it's not just a canvas instead of one lebble, but one canvas instead of a bunch of labels.
Run expert CanvasVsLabels.mq5, select display typeoutType, enable limit_fps, set, nIterations, it is 10000 by default. This is enough, you do not need to change it. Then the results will be similar to the ones presented here: https://www.mql5.com/ru/forum/364640/page11#comment_21301589.
Now for the results. Min delay,Mid delay andMax delay are the minimum, average and maximum delays, respectively, for one run. Total, is the total time for the total number ofnIterations passes.
Once again, here is a table with comparisonresults
Exactly the same measurements can be taken in the tester, as the examiner is designed to do so. But I haven't done them yet. I will do so when I have some free time. I plan to experiment with a display of many BitmabLabels in the future.
Forum on trading, automated trading systems and strategy testing
Canvas vs Labels
fxsaber, 2021.03.13 19:26
I'm the only one with this kind of result?
Takes away 15-20%. Apparently, my video card is too slow.
Turns out ResourceReadImage is very slow. Got rid of it - got zero load.
Once again I publish the comparison table, but this time with histograms.
Comparison of average delay values per pass
Which for some reason were not comparable to the total running time (Total)...
Comparison of total running time
Measurements showed that Canvas based display with limited FPS (Canvas unlimited FPS) is a bit slower than Labels based display with limited FPS (Labels unlimited FPS). But in general they are both suitable for displaying information from highly loaded processes.
How to run the Expert Advisor to take measurements
The Expert Advisor can take measurements in the visual tester in exactly the same way. However, the date range should be set in the tester settings so as to have at least as many bars in the history as the value of the input parameternIterations.
More information, as well as sources, can be found in the description of Chart Display library:https://www.mql5.com/ru/code/33898
Library specially modified for measurements:https://www.mql5.com/ru/code/download/33898/chartdisplay.mqh
Universal expert for measurement:https://www.mql5.com/ru/code/download/33898/canvasvslabels.mq5
For more details see KB: https://www.mql5.com/ru/code/33898
I would like to add more correct measurements, made with the new Expert Advisor in the very first post of this thread. As those measurements, which are there at the moment, are not correct. But the first message, unfortunately, cannot be edited anymore. I ask moderators to add more correct measurements to the beginning, and to mark the ones that are there now as irrelevant.
It turned out that ResourceReadImage is very slow. Got rid of it - zero load.
Running expert CanvasVsLabels.mq5...
What's the point? I don't want to dig into the code right now. How are these values calculated? If you test in the tester, you should measure the total time spent on the run and nothing else, but not the performance of individual code fragments. In the extreme case, do not count the inite. And here, without measuring, you can see that kanvas is slower. I don't know, maybe I have some kind of anomaly...
Really?
With calling it was about 15% load, without - zero.
What's the point? I don't want to dig into the code right now. How are these figures calculated? If you test in the tester like that, you should measure the total time spent on the run and nothing else, and not the performance of separate code fragments. In the extreme case, do not count the inite. And here, without measuring, you can see that kanvas is slower. I don't know, maybe I have some kind of anomaly...
I don't want to dig into the code. I don't want to take my word for it either. :) I don't know how to explain it to you. Telling you from beginning to end how I wrote all the code... It'd be a whole article. :)
And there's nothing to understand about how an expert makes measurements at all.
Total is calculated at the end of the loop and min, mid and max in the body of the loop, after display.push, display.setText and display.update. Nothing complicated, if you sit down and take a good look at everything, you can get at least to the source code of Kanvas and Labels. There's nothing complicated there either, by the way. Except for the methods that draw Bezier curves and the like in Kanvas.And here, without measurements, you can see that the kanvas is slower. I don't know, maybe I have some kind of anomaly...
You need to tell me at what input parameters Kanvas is slow. If limit_fps: false, then it's obvious... :)
It turned out that ResourceReadImage is very slow. Got rid of it and got zero load.
If you read from a resource saved at compile time, you have to do it once.
Resources are compressed at compile time.