MetaTrader 5 Python User Group - how to use Python in Metatrader - page 23

 
Lyuk:


The only sad thing is that the number crunchers have only accelerated by about 12 times in the last 15 years, I thought modern CPUs were faster.

I have an old i7-3770K, it's seven years old. Today's CPUs are faster.

 
Roman:

I have an old i7-3770K, it's seven years old. Modern CPUs are faster.

Alas, your 3770K is easily overclocked up to 4.8Ghz, even if it would be more ancient 2600K, you would reach paradise for overclocking, the whole point is tendency to reduce CPU size which leads to cooling problems. For example 6xxx is even a problem to overclock. On the whole for users specifications didn't change much except for latest i9 which became more like xeons. The advantage of xeons is energy efficiency as opposed to CPUs for normal consumers. so your 3770k is still quite normal for the average user

 
There's a thread about processor tests, and the author has done a good job of collecting statistics.
If you are interested, you can test your processors.
Оцениваем ядра CPU для оптимизации
Оцениваем ядра CPU для оптимизации
  • 2019.08.09
  • www.mql5.com
Предлагаю собрать статистику по производительности разных процессоров с целью оценки их эффективности для работы тестера стратегий в режиме оптимиз...
 

Tested it on Windows7 32bit virtual machine with 2 AMD FX cores.

On mql5 it was 6 sec.

On Python in one thread it was 2.5 sec.

That's a lot faster , and even faster than you on I7 in one thread which is amazing.

Apparently jit compiler works better for AMD, or AMD is better for such tasks.

 
So Python with a jit compiler beats C (mql) by a factor of 2 ! If you run it on a modern 8 core processor, it beats C by a factor of 8 simply because it's multi-threaded.

Well, normal test, allowed to python to bump exact compliance with IEEE standard (fastmath=true), then you need to slip -Ofast to syshka too. And then there is OpenMP, parallelize loop with it - [a couple of extra lines](https://www.ibm.com/developerworks/ru/library/au-aix-openmp-framework/index.html).

Fans of abstractions... What if there is another add-on on top of python? What if there is one more? Compile to byte code of virtual machine virtual machine virtual machine.

 

Unfortunately, a countable number of algorithms can be decomposed into parallelism.

The given example of pi calculation is just for demonstration of such synthetic test. The same way is done with OpenMP in C++. It can be done even faster in MQL5 with OpenCL.

 

I have found such a parallelism parameter for loops in Visual Studio.
Can we implement such a directive in mql as well?
Or are the loops in mql paralleled by default?

vs

 
Roman:

I have found such a parallelism parameter for loops in Visual Studio.
Can we implement such a directive in mql as well?
Or are loops in mql paralleled by default?

I haven't managed to see use of this parameter in Visual Studio (as well as all the rest) for the last 10 years. Even having turned on all the flags of loop unfolding reporting.

It simply didn't work and doesn't work even on large projects where there are a lot of possibilities to parallelize. Only direct OpenMP with manual marking of loops works.

In MQL5, the loops are not paralleled.

 
Renat Fatkhullin:

Unfortunately, a countable number of algorithms can be decomposed into parallelism.

The given example of pi calculation is just for demonstration of such synthetic test. The same way is done with OpenMP in C++. It can be done even faster in MQL5 with OpenCL.

I posted a calculation on the blog that parallels perfectly. Unfortunately, OpenCL information is of such a level that it requires much higher competence than I have.

I would like to see a simple example (like in the blog) of an OpenCL implementation and the result of acceleration.

 
fxsaber:

I've posted a calculation on the blog that parallels perfectly. Unfortunately, the OpenCL information is of such a level that it requires much higher competence than I have.

I would like to see a simple example (like in the blog) of an OpenCL implementation and the result of acceleration.

Off the subject of OpCl but on the subject of Python

Visually similar cases are also quite well defined (incremental distributions)

Note the group 0-6 hours (by GMT + 2)

Months in 10 years

Hours in 10 years


Reason: