Errors, bugs, questions - page 975

 

I stand corrected. Bitmap performance is inferior to tags by 16%-25%(depending on the number of elements), but not by an order of magnitude, as I wrote earlier.

There were probably errors/inefficiencies in the code when first learning the tool.

The code is attached.

tol64

Believe me,I don't have a single motiveto deceive you = myself. In my first experiment I observed a bitmap in the tester. Unfortunately, I can't reproduce it. :(

 
voix_kas:

...

tol64

Believe me,I don't have a single motiveto deceive you = myself. In my first experiment I observed a bitmap in the tester. Unfortunately, I can't reproduce it. :(

Ok. Let's wait for developers to implement this feature and then we will test it properly. )))
 

I would also like to draw the developers' attention to the differences in the display of fonts:


On the left is the bitmap and on the right the labels.The bitmap has a slightly bolder rendering of the font, although all the settings are the same.

The question is not critical. But for order pay attention. :)

 
voix_kas:

I would also like to draw the attention of developers to the differences in the display of fonts

On the left is the bitmap, on the right the labels.The bitmap has a slightly bolder font rendering, although all the settings are the same.

The issue is not critical. But for order it is necessary to pay attention. :)

And what flag to set the font thickness did you use for the bitmap ?
 
voix_kas:

I stand corrected. Bitmap performance is inferior to tags by 16%-25%(depending on number of elements), but not by an order of magnitude, as I wrote earlier.


no. Yet your test is incorrect.

You use ChartRedraw after each change. So in fact you are testing 10000 times ChartRedraw. This is not right.

The task is to find out what changes faster - labels or bitmaps. And not their subsequent output on chart.

Here are the test results if you leave ChartRedraw inside a loop.

Bitmap update time = 40980.
Time to update labels = 41777.

(i.e. bitmap is even slightly faster than labels).

And I want you to note that the number of labels and bitmap width in the presence of ChartRedraw inside the loop - does not affect anything. So, the ChartRedraw function is the slowest in this situation.

---

If you remove ChartRedraw from the loop, you will get completely different numbers

Bitmap refresh time = 5788.
Time of update of labels = 234.

so the terminal with the tags is 20 times faster than the bitmap


and here, of course, we can already see the bitmap height dependence. for 100 marks:

Bitmap update time = 51355.
Time of updating of labels = 1108.
50 times difference

and here is a bitmap with size 250*20. i.e. do not change coordinates of marks.

we get

Bitmap update time = 25054.

The difference with hundred marks is 25 times.


So, as you can see the bitmap is really slow as far as working with it is concerned.

unambiguously, that constant cyclic work with arrays + WinGdi TextOut + creation of ResourceCreate = inferior to native MT objects by at least an order, or even 50 times.

That is why you should not refuse from MT objects. As it probably will be very convenient for drawing graphs and histograms.

Документация по MQL5: Операции с графиками / ChartRedraw
Документация по MQL5: Операции с графиками / ChartRedraw
  • www.mql5.com
Операции с графиками / ChartRedraw - Документация по MQL5
 
tol64:
And what flag to set the font thickness did you use for the bitmap ?

The default value is 0, I don't set it explicitly. You can see it in the attached source code.

Additional "play" with different flags also did not lead to uniformity.

 
sergeev:

...

The goal is to find out whether labels or bitmaps modify faster. Not their subsequent output to the chart.

...

The removal of ChartRedraw() function from loop is incorrect, because the "atomic operation" of text label property modification is in no way handled by video-motor of the terminal.

Only when calling ChartRedraw() the entire window is drawn, including mutual overlapping of alpha-channel images from different objects.

This hypothesis is strictly confirmed by the code profiler on the script with text labels.

As for the bitmap, the bottleneck is the TextOut() function.

 
voix_kas:

...

As for the bitmap, the bottleneck is the TextOut() function.

That's more clear: ))

 
tol64:

That's the way to make it clearer: ))

I agree. :)

sergeev:

...

here are the test results if you leave ChartRedraw inside the loop.

Bitmap update time = 40980.
Time to refresh labels = 41777.

(i.e. the bitmap is even slightly faster than the tags)

Strange, I have the opposite picture:

 

Argb_normalize is best not used, as it gives extra cost for colour normalisation. It is better to paint simple things in pure colour.

Also the speed is directly and strongly influenced by the video card, as we are making full use of its 2D features. For example, on weak laptops with rudimentary graphics cards, rendering is slow and the difference in output methods is large.

Документация по MQL5: Стандартные константы, перечисления и структуры / Константы индикаторов / Стили рисования
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы индикаторов / Стили рисования
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы индикаторов / Стили рисования - Документация по MQL5
Reason: