原子操作你好。
我正在嘗試測量此過濾器的已用時間(計算列'PowerRail'的10秒移動平均值):
...
tStart = HP Time();
new_col << Formula( Summation( i = 1,10,Lag(dt:PowerRail,i))/10);
tStop = HP Time();
...
似乎不是線性地進行,而是調用新線程並且不實現完成操作的實際時間。
就目前而言,測量200uS是不現實的。帶有“PowerRail”列的CSV文件大小為11GB。200uS更有可能是調用新線程的時候。
在腳本結束時,JMP表打開,移動平均值顯示在表的可見區域中,但如果我向下滾動,我會看到公式沒有完全處理整個列。
是否可以在原子操作中運行公式,即不在不同的線程中運行公式,以便測量實際完成時間?
提前致謝。
回复:原子操作這只是一個FYI,你是在互動地看待表現。使用JMP調試器運行腳本,然後在井號#上選擇看起來像時鐘的按鈕。它返回步驟中的時間百分比,或完成計算的“步驟”數。下面是腳本,時間差和調試器性能。它表示Col Moving Average()函數是最好的方法。
Names default to here(1);
dt = New Table("Test", New Column("random", numeric), New Column("MA1", numeric),
New Column("MA2", numeric),
New Column("MA3", numeric),
);
dt << add rows(2000000);
xmat = J(2000000, 2, Random Integer(1,10));
dt:random << Set values(xmat[0,1]);
wait(5);
t1 = HP Time();
dt:MA1 << Formula( Summation( i = 1,10,Lag(dt:random,i))/10, <<RUN formula=""></RUN>以下是數字結果:
t4 - t3 = 166; // 使用Col移動平均線
t3 - t2 = 2246576; // 使用For循環
t2 - t1 = 1038; // 使用求和公式除以10
以下是調試器性能報告的屏幕截圖

回复:原子操作1H,
感謝你的快速回复。
使用'Run Formulas()',運行過濾器的時間實際上是4個小時!
回复:原子操作在實際評估公式之前,腳本仍然是正確的;通常這是首選,否則你的腳本可能會永遠運行。 您可以使用運行公式使腳本等待:
Names default to here( 1 );
//Open sample data and create a column to modify
dt = Open("$Sample_Data/iris.jmp");
new_col = dt << New Column("Test",Numeric,"Continuous",Formula(1));
//Set the column formula
tStart = HP Time();
new_col << Formula( for(i=1,i<=100000, i++, i+1) );
tMiddle = HP Time();
print(tMiddle-tStart);
//Wait for the formula to finish calculating
dt << Run Formulas();
tStop = HP Time();
print(tStop-tStart);