Questions from a "dummy" - page 167

 
stringo:

When parameters are passed to a function, the minimum quantum is a 32-bit integer. That is, in your case bVk and bScan will be converted to int type before being passed into the function

That's why the above function prototypes don't contradict each other

Thank you.
 

Tell me whether the FIRST OPTION is worse in terms of CPU and RAM usage.

Given: several half-empty arrays that need to be filled.

Option 1: we fill one array cell, then jump to another array, fill a cell in it, then jump to the next array and so on... then go back to the first array and fill in the next rows of array cells.

Option 2: We fill the array completely, then jump to the next array.

(Actually, the question is HOW work with arrays in MQL5).

 
Option 1 will be faster.
 
joo:
option 1 will be faster.

Hmm... that's a bit of a mystery.

Maybe you should just do a test and see.

 
sergeev:

Hmm... ...that's puzzling.

Maybe you should just do a test and see.

In the first option there is one cycle, in the second there are 3 cycles.

the looping also takes time, so it'll be different depending on the length of the addition,

But in the second variant there is a consecutive scanning of one data area.

Tests won't give anything, because of optimisation.

so the question goes directly to the MQ guys.

 
Urain:

In the first version there will be one cycle, in the second 3.

Exactly.
 
Urain:

In the first case there will be one cycle, in the second there will be three.

Nope, in both cases there are two nested loops.

imho, purely intuitively) it should be the same in terms of speed.

 
Swan:

Nope, in both cases there are two nested loops.

imho, purely intuitively) it should be the same in terms of speed.

Two nested loops are if the array is two dimensional.

and if three one-dimensional arrays of the same size, then 1 : 3

 

Urain, joo, sergeev, swan: Thanks. Decided to go with the second option (new factors have emerged which have determined the choice).

 
Swan:

Nope, in both cases there are two nested loops.

imho, purely intuitively) it should be the same in terms of speed.

That's what it felt like to me. I must be tired.

sergeev:

Two nested loops are if the array is two-dimensional.

and if three one-dimensional arrays of the same size, it should be 1 : 3

It's not clear. I hope to get there in time. =)