DirectX - page 10

 
Реter Konow:

Where are the changes in the table? Is it redrawn?

Yes it redraws all the time.

in general without pause the script threw 3 tests

2020.03.14 22:21:20.152 tst_T (EURUSD,H1) #1: loops=1000 ms=360

2020.03.14 22:21:23.558 tst_T (EURUSD,H1) #2: loops=10000 ms=3406

2020.03.14 22:21:59.366 tst_T (EURUSD,H1) #3: loops=100000 ms=35812

1000 - 100 000 loops and value updates.... amazingly, .Net + WinForm is quite productive even for such obscure tasks, nothing lags even on my laptop

#import "LogToWinForm.dll"
#import

double price[20];

#define    SpeedTest(count_x10,msg,EX)        {uint mss=GetTickCount(); ulong count=(ulong)pow(10,count_x10);for(ulong ii=0;ii<count&&!_StopFlag;ii++){EX;} \
                                              printf("%s: loops=%i ms=%u",msg,count,GetTickCount()-mss);}

//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
{
   ArrayInitialize(price, 1.0);
   while(!Log::InitForm()) Sleep(200);
   Sleep(1000);

   SpeedTest(3, "№ 1", sendTodl());
   SpeedTest(4, "№ 2", sendTodl());
   SpeedTest(5, "№ 3", sendTodl());
}
//+------------------------------------------------------------------+
void sendTodl()
{
   for(int i = 0; i < 19; i++)
   {
      price[i] = price[i + 1];
   }
   price[19] = NormalizeDouble(price[18] + _Point, _Digits);
   double ask = NormalizeDouble((double)rand() * _Point, _Digits);
   double bid = NormalizeDouble((double)rand() * _Point, _Digits);
   Log::PrintToLog(ask, bid, price);
};
//+------------------------------------------------------------------+

speed figures are even, it turns out that 22 double values (double, double double double[]) cast into .dll and update completely WinForms takes 0.3 ms

UPD: and now you can see that at this speed of update the load on CPU is present


 
Igor Makanu:

It keeps redrawing.

in general without pause the script threw 3 tests

2020.03.14 22:21:20.152 tst_T (EURUSD,H1) # 1: loops=1000 ms=360

2020.03.14 22:21:23.558 tst_T (EURUSD,H1) #2: loops=10000 ms=3406

2020.03.14 22:21:59.366 tst_T (EURUSD,H1) #3: loops=100000 ms=35812

1000 - 100 000 loops and value updates.... amazingly, .Net + WinForm is quite productive even for such obscure tasks, nothing lags even on my laptop

speed figures are even, it turns out that 22 double values (double, double double double[]) cast into .dll and update completely WinForms takes 0.3 ms

UPD: now you can see that such speed of update places load on CPU


I need to write to microsoft company.))

They have a higher load of table updates than I do. Put the refresh every 16ms.



ZS. Build an equivalent table on sharpe. Interesting to compare the load.

Files:
GUI_Expert.ex5  600 kb
 
12 ms would be more correct
 
Реter Konow:

I have to write to the micro-soft company.))

They have a heavier load of table updates than I do. Set it to refresh every 16ms.



ZS. Build an equivalent table on sharpe. Interesting to compare the load.

Write, but try 1 million times to refresh the table, when exchanging with Net it took

2020.03.14 23:22:24.039 tst_T (EURUSD,H1) #4: loops=1000000 ms=322531

the update is less than 16 ms at me - I wrote above 0.3 ms

But note that this is a completely independent form (window), it gets all Win events, so I wanted to test it - I was wondering if the .Net hangs on such an exchange and lags everything

ZS: tomorrow maybe on the PC to check this script there more powerful than the laptop processor, at least the tester (optimizer) is almost 3 times faster than on a laptop, although it makes no sense - running .Net is very, very good

 
Igor Makanu:

write, but try 1 million times to update the table, when exchanging with Net it took

2020.03.14 23:22:24.039 tst_T (EURUSD,H1) #4: loops=1000000 ms=322531

But note that this is a completely independent form (window), it receives all Win events, in general, I wanted to test it - it was interesting whether the .Net would freeze at such an exchange and whether everything lags

SZS: tomorrow maybe on the PC to check this script there more powerful than the laptop processor, at least the tester (the optimizer) is almost 3 times faster than on a laptop, although there is no point - running .Net is very, very good

And why update it a million times? It would be cheaper to update the table in real time at 16 ms. The rest is unnecessary because the event model is not faster. It's about the load on redrawing.

 
Реter Konow:

Why update it a million times? It would be cheaper for us to update the table in real time at 16ms. The rest is unnecessary because the event model is not faster. We're talking about the redrawing load.

So there's a lot to strive for.

ZS: put the pause at 16 ms, well, the processor at the peak is only 1.5% of the load, here's catching the moment, and note the processor of the laptop!

I'm not interested in arguments, I just wanted to check MQL5 + .Net capabilities - everything works very cool!

 
Igor Makanu:

then there's something to strive for.

SZY: put a pause at 16 ms, the processor is only 1.5% of the load at the peak, here's the moment, and note the processor of the laptop!

It was interesting to check the capabilities of MQL5 + .Net - everything works very cool!

And so we haven't checked it. That is, we haven't compared them. I've created two analogous tables - in MCL and Sharp and have a look at what load is given by each of them when redrawing their cells at 16 msec. On MKL I have provided a table. Now, we need the same on Sharpe. And then it will become clear who is ahead.

I will add that sharp table should be connected to MT5 via dll and then compare.

 
Реter Konow:

So we didn't check. That is, we haven't compared. We need to create two similar tables - on MKL and on Sharp and see what load each gives when redrawing its cells at 16ms. On MKL I have provided a table. Now, we need the same on Sharpe. And then it will become clear who is ahead.

I'll add that sharp table should be connected to MT5 through dll and then compare.

I don't buy it - I know that nothing will change, well, 0.1ms will be added if you roll 50-100 values and fill them in the table for 3 columns

you may consider that you defeated Microsoft and their .Net ))))

ZS: I am comfortable that the code on .Net took me 15 minutes to write, about 50 lines in total, works fast, no lags noticed ;)

 
Igor Makanu:

I don't buy it - I know that nothing will change, well, 0.1 ms will be added when you send 50-100 values and fill them in the table in 3 columns

you may consider that you've defeated Microsoft and their .Net ))))

SZZY: I am comfortable, it took me 15 minutes to write the .Net code, about 50 lines in total, works fast, no lags noticed ;)

There's no victory without a fight...))

I'm willing to bet that soon I'll beat Sharp's GUI designer in speed of GUI building. By leaps and bounds.

Checked it out at the moment. It's not geared up for speedy builds. Pity about him...)))

 
Реter Konow:

I've just had a look at it. He's not grounded in speed building. Pity him...))

Well... you're a lamer Peter - and a rare one at that )))))

Sharp is maximum close to C++, the difference in productivity, well, maximum 5% and then there may be no difference in productivity - it takes a long time to write simple tasks on C++, on Net all primitive tasks are done within an hour - maximum day ;)

I was about to go to work, but I have added 2 more columns in three clicks and forwarded from MQL5 to .dll now 3x50 = 150 double (3 arrays of 50)

measured the speed now - and keep in mind that the scroll bars now require resources - completely updated WinForm

here is the same test before 100 000 updates

2020.03.15 00:12:21.812 tst_T (EURUSD,H1) no1: loops=1000 ms=1610

2020.03.15 00:12:38.382 tst_T (EURUSD,H1) no.2: loops=10000 ms=16562

2020.03.15 00:15:19.642 tst_T (EURUSD,H1) #3: loops=100000 ms=161250

i.e. WinForm on .Net in the window with scroll bars and table of 153 cells on my laptop updates in 1.6 ms

Files:
MQL5.zip  209 kb