Hello, just a quick question, in your experience, ...
# suitescript
i
Hello, just a quick question, in your experience, what could be causing a
MR
to proccess thing more slowly than a schedule? I just created a
MR
based on a
schedule
script, the only difference between the two is that I separated the data gathering on the
MR
on the
getInputData
and all the logic I put it on the
MAP
stage, the code is the same, but did some tests and the schedule takes less time to process the same records than the
MR
, tried with 100 records and the
scheduled
did half the time the
MR
n
What is your concurrency for MR? 2 threads are available by default. So, just by that it should do the job in 1/2 time by processing 2 records together.
i
It is one, now that we are talking about it, how does that work for example with the data that gets send to the map stage? I mean how does it work with 2 instances that are doing the same, based on the help can I assume that getInputDta runs once an then it divides the results on the number of concurrency set (map)
Lets say I get an array
[1,2,3,4]
if I have two threads? it would send
1
and`2` then when it finishes,
3
and
4
. Sorry for my basic questions. Im fairly new to MR scripts 😅
b
just assume that netsuite will try to split the data between the 2 (or however many processors you have)
dont expect a consistent split, though you might actually get it with such a small dataset
whats probably happening is that the data from getInputData is in a queue and each processor is popping off the first (or whatever your buffer size is) in the queue to process
n
As battk mentioned, you cannot predict the split. It can process 1 and 3 together, then 2 and 4. May be 1 and 2 are processed, when one of the them is finished, it picks up next for one thread, then the next for another.
i
Thanks guys!
s
It also could be dependent on other scripts running in the environment, the MR could be getting put in line (behind something else running) between stages where the scheduled script would enter the line once and go all the way
s
MR scripts aren't automatically faster than Scheduled, in my experience.