Thanks @willcattoneeca! Probably a lot of time is spent on filtering here:
The following code takes almost 26 sec.
I can experiment with relational algebra instead.
Code:
EQ_PTRANS[
r in REGION,
p in PROCESS,
cg1 in COMGRP,
cg2 in COMGRP,
s1 in TSLICE,
t in MILEYR,
v in MODLYR,
s in TSLICE;
(r, p, cg1, cg2, s1) in RP_PTRAN &&
(r, s1, s) in eachindex(RS_FR) &&
s in RP_S1[r, p] &&
(r, t, p) in RTP_VARA &&
v in RTP_VNT[r, t, p],
]The following code takes almost 26 sec.
Code:
[(r, p, cg1, cg2, s1, t, v, s)
for r in REGION
for p in PROCESS
for cg1 in COMGRP
for cg2 in COMGRP
for s1 in TSLICE
for t in MILEYR
for v in MODLYR
for s in TSLICE
if (
(r, p, cg1, cg2, s1) in RP_PTRAN &&
(r, s1, s) in eachindex(RS_FR) &&
s in RP_S1[r, p] &&
(r, t, p) in RTP_VARA &&
v in RTP_VNT[r, t, p]
)
]I can experiment with relational algebra instead.
