Get the number of decimal places of any numbers (not just quotes) bypassing Digits() in MQL4 and MQL5 - page 20

 
Алексей Тарабанов:

The result of what?

Speeds
 
fxsaber:

Multiplicity is the condition of the problem.

Simple, a puzzle?

 
Алексей Тарабанов:

Simply, a puzzle?

Practical applications

Forum on trading, automated trading systems and strategy testing

New version of MetaTrader 5 build 1930: Floating chart windows and .Net libraries in MQL5

fxsaber, 2018.12.09 00:18

This example now runs 15x faster

1000000
Time[TestResource()] = 286646


Roughly speaking, the full write/read ticks cycle through the resource is running at 4 million ticks per second.


Forum on trading, automated trading systems and trading strategy testing

Discussion on "Multithreaded asynchronous WebRequest in MQL5 with your own hands" article

fxsaber, 2018.12.09 00:52

Try the updated Resource_Data.mqh, the web page transfer lags should disappear.

#include <fxsaber\TradeTransactions\ResourceData.mqh> // https://www.mql5.com/ru/code/22166

#define  BENCH(A)                                                              \
{                                                                             \
  const ulong StartTime = GetMicrosecondCount();                              \
  A;                                                                          \
  Print("Time[" + #A + "] = " + (string)(GetMicrosecondCount() - StartTime)); \
}  

const RESOURCEDATA<uchar> Resource("::" + __FILE__); // Ресурс для передачи данных (байты)
uchar BytesIn[];
const int Init = ArrayResize(BytesIn, 1000000);

void TestResource()
{
  uchar BytesOut[];

  Resource = BytesIn;
  Print(Resource.Get(BytesOut));
}

void OnStart()
{
  BENCH(TestResource());
}


Old version

1000000
Time[TestResource()] = 103746


New Version

1000000
Time[TestResource()] = 5222
 
Ilya Malev:

Is there a comparison of sorting speed with regular built-in ArraySort on random sampling? Any method that sorts random data faster on average...

Or not faster, but at least the same. Or not as fast, but at least not longer than twice as long. Without any Dll and other stuff like multithreading

There is a source code, you can measure it yourself.

 
Lazybones.
 
Nikolai Semko:
Can't get past it.
I'll be sure to participate when I get to the computer.
After a quick look, I already have ideas on how to improve the results by 10-20%.

Already stuck at maximum performance, I'm afraid.

 
fxsaber:

I'm afraid we're already locked into maximum performance.

Perhaps there's something I haven't noticed. But if you only use one type of union, there is still potential.
 
Nikolai Semko:
There might be something I haven't noticed. But if you only use one type of union, there is still potential.

Glad to be wrong.

 
Алексей Тарабанов:
Lazybones.
You stink of booze. Stop drinking, Comrade Lieutenant Colonel.
 
fxsaber:

Glad to be wrong.

It is on the way now. You may try it yourself. The idea is to use unions with arrays of structures of different sizes, for example 10, 100, 1000, 10000...
This will shorten the loop by orders of magnitude and reduce the number of ArrayCopy calls by orders of magnitude.
This should be close to the memcopy variant
Reason: