Canvas vs Labels - page 10

 
Dmitry Fedoseev:
Even a purely dumb comparison of just one call to TextOut() is 70 times slower than outputting text to a label.

You just don't realise that the rate at which a label is updated cannot be correctly measured. The label text is simply passed to the chart for processing, this is a fast procedure. But how much it is processed there is impossible to know, because the chart works in a completely different thread, in parallel with the main application. Read the link I gave, as well as the posts below, everything is described there in detail. There's no point in retelling everything all over again.

 
Mihail Matkovskij:

You just don't realise that the rate at which a label is updated cannot be correctly measured. The label text is simply passed to the chart for processing, this is a fast procedure. But it is impossible to know how much it is processed there, because the chart works in a completely different thread, in parallel with the main application. Read the link I gave, as well as the posts below, everything is described there in detail. There's no point in retelling everything all over again.

You'd better read my second sentence at that link.

 
Dmitry Fedoseev:

You'd better read the second sentence in that link of mine.

I got it. Just take it and measure it. And what led you to the result, aren't you interested...? :)

 
Mihail Matkovskij:

I get it. Just taking and measuring. And what led you to the result you got, you're not interested...? :)

I am only interested in the result I can have. The other results are of no use to me.

 
Dmitry Fedoseev:

I am only interested in the results I can have. The other results are of no use to me.

I see. Then I suggest you measure the speed of the source code, which will be ready soon. You will be surprised at the result.

 

when it comes toDmitry Fedoseev

someone else will come and Dmitry will convince him )))) the circle of common sense in nature)

Dmitry Fedoseev
Dmitry Fedoseev
  • 2021.02.06
  • www.mql5.com
Профиль трейдера
 
Aleksey Mavrin:

when it comes toDmitry Fedoseev

Someone else will come and Dmitry will convince him ))))

Convince him of what? That the Earth is flat? Or that the Sun revolves around the Earth?

 
Dmitry Fedoseev:

Convince us of what? That the Earth is flat? Or that the Sun revolves around the Earth?

Yes, I understand you, the main thing is to put in a queue and then let the code be executed without waiting. But sometimes it is critical if you have to do it a lot. And I think we can timer redraw the code so that it doesn't wait.

 
Aleksey Mavrin:

when it comes toDmitry Fedoseev

Someone else will come along and he will already be convinced by Dmitry )))) The circle of common sense in nature).

It's just that I've never thought before why the Labels are faster than Kanvas, if everything is used as it is. But when you know what's "under the bonnet", you already start thinking more constructively. Obviously, there are two reasons why the labels can win in speed.

  1. Separate stream
  2. Optimisation of the frequency of chart updates (so as not to overload the processor unnecessarily)
A simple logical conclusion then follows that BitmatLabel updates should also be optimised or limited. For labels, updates are optimized in the chart. At least optimizing them further wouldn't be out of place either. ForBitmatLabel the programmer on the other hand is responsible. There is nothing complicated about it. If it had been written about it in the documentation, for example, I would have known it before.
 
Mihail Matkovskij:

I just haven't really thought about why the Labels are faster than Canvas before, if everything is used as it is. But when you know what's 'under the bonnet', you start to think more constructively. Obviously, there are two reasons why the labels can win in speed.

  1. Separate stream
  2. Optimisation of the frequency of chart updates (so as not to overload the processor unnecessarily)
A simple logical conclusion then follows that BitmatLabel updates should also be optimised or limited. For labels, updates are optimized in the chart. At least optimizing them further wouldn't be out of place either. ForBitmatLabel the programmer on the other hand is responsible. There is nothing complicated about it. If it was written in the documentation, for instance, I would have known about it before.

I understand. If I use any library, I try to understand its internals first, this helps me make a decision in case usage isn't reasonable and avoid "awkward" scenarios when something goes wrong.