Canvas vs Labels - page 3

 

Alexey Viktorov:

...

Nikolai Semko:
What can we talk about if he measures in milliseconds, not micro ...

So measure in microseconds, surprise the readers of this thread. The library is freely accessible:https://www.mql5.com/ru/code/33898 . You can make anything you like out of it. Who prevents you from doing so...?

Alexey Viktorov:
In general, I think all that discussion should be moved to the CodeBase topic. Right there...
There is already a special thread for thisat https://www.mql5.com/ru/forum/364643 . Only the library itself is discussed there, not its performance test. While working on this project, I decided to "kill two birds with one stone", to make a comparative test and to give programmers an opportunity to easily organize text output to the chart.
Дисплей с оптимизацией для вывода текста в чарт по типу консоли
Дисплей с оптимизацией для вывода текста в чарт по типу консоли
  • www.mql5.com
Данная библиотека позволяет создавать дисплеи для удобного вывода текстовой информации в чарт с наиболее оптимальной скоростью
 
Mihail Matkovskij:

So do the microsecond measurements, surprise the readers of this thread. The library is freely available:https://www.mql5.com/ru/code/33898 . You can make anything you want based on it. Who's stopping you...?

There isalready a special topic for thathttps://www.mql5.com/ru/forum/364643 . Only the library itself is discussed there, not the performance test. While working on this project I decided to "kill two birds with one stone", conduct a comparative test and give programmers an opportunity to easily organize text output to chart.

There's nothing to discuss. All discussion consists of one bad word. I noticed long ago that good codes are not posted on CodeBase.

 
Alexey Viktorov:

There is nothing to discuss there. The whole discussion is encapsulated in one bad word. I've noticed for a long time that good codes are not posted in CodeBase.

If it's really so, it will be an empty thread... And keep your naughty words to yourself, you heater! Artyom seems to have already warned you not to engage in flooding...

And what about the fact that you don't like something in other Community members' codes, add your own, who's stopping you...! Or is it just about hatin' other community members?!...

 
Nikolai Semko:
What can we talk about if he's measuring in milliseconds and not micro, and even single pass. And what's more, he doesn't even understand that he is measuring filling the table of object characteristics(which takes tens of microseconds at most) and not the forming of the object itself.

The topic caught my attention as I'm planning to start using Kanvas. I've read all the way to here and it all made sense, I thought so) Nikolai, don't waste your time arguing (if only for fun) ), everyone who understands what's what.

 
Alexey Viktorov:

There is nothing to discuss there. The whole discussion is encapsulated in one bad word. I've noticed for a long time that good codes are not posted on CodeBase.

Fxsaber is an exception.
Don't feed the troll, he's openly networking and you're trying to prove something to him.
 
Aleksei Beliakov:
Fxsaber is an exception.
Don't feed the troll, he's clearly networking and you're trying to prove something to him.

There are no exceptions for me. I can't make sense of what Fxsaber writes and I can't use blindly.

And this character does not look like a troll. He looks more like Know-Nothing pretending to be a professor.

 

Of course, of course, I don't know anything and I don't know anything about anything. :) And the measurements presented don't tell me anything. :) Also, the source:https://www.mql5.com/ru/code/33898 doesn't carry any information. :) I won't say yours is true, but I have no need to argue with you either!

I'll update the measurement results soon, which will already be in microseconds! Plus, measurements of the combined display variant, Labels + Kanvas. A reminder thatno trollingis welcome in this discussion! Only clearly justified arguments! !! Also, questions of substance!

Дисплей с оптимизацией для вывода текста в чарт по типу консоли
Дисплей с оптимизацией для вывода текста в чарт по типу консоли
  • www.mql5.com
Данная библиотека позволяет создавать дисплеи для удобного вывода текстовой информации в чарт с наиболее оптимальной скоростью
 

So, presenting the updated results as promised. At the same time, I decided to add a variant of the display with Kanvas as a background to the comparison. Also, I took the programmers' comments into account and measured in microseconds, for greater accuracy. Plus, minimum, average and maximum delays on ticks began to be correctly detected.

I tested it on the simplest model of ticks "Open prices only". Hence, there are small nuances in the display on the labels.

Canvas

Input parameters

Result

Labels with Canvas as background, without optimizing output speed

Labels with background and with optimized output speed

Labels without background, without optimisation of output speed

Labels without background, with optimized output speed

Results table

Canvas Labels Background Labels Background Optimized Labels Labels Optimized
Min delay (μs) 2182 17 16 16 13
Mid delay (μs) 8850 27 24 22 25
Max delay (μs) 25427 849 744 580 886
Total (μs) 141841997 565420 503329 441632 528236


So the advantages of using labelsin this type of task are obvious. Anyone wishing to replicate the measurements or anyone needing an easy way to output text to a chart can download the source code here: https://www.mql5.com/ru/code/33898.


 
Mihail Matkovskij:

So, presenting the updated results as promised. At the same time, I decided to add a variant of the display with Kanvas as a background to the comparison. Also, I took the programmers' comments into account and measured in microseconds, for greater accuracy. Plus, minimum, average and maximum delays on ticks started to be correctly determined.



Thus, advantages of using labelsin this type of tasks are obvious. Anyone who wants to repeat the measurements or anyone who needs easy way to output text to chart can download source code here: https://www.mql5.com/ru/code/33898.


Obviously Canvas (BitMap) is redrawn/copied whole and labels only which have changed. Why am I surprised ?

Canvas is just handy and moderately fast.

 
And without comparative tests, it's obvious that a simple label will output text faster.