I can't see much difference between native and interpreted compilation
713378Sep 19 2009 — edited Sep 23 2009Hi,
I have an application that uses own split function to tokenizer a string into pieces. Loop has been iterated 2million times and in each loop step, a fixed string has splitted into pieces. So, i wanted to try to measure between native and interpreted compilation. But i could not see big difference. In native compilation 80597 cpu time elapsed, in interpreted compilation 81848 cpu time elapsed. At least, i expected %10 difference between them.
How did I perform these tests:
ALTER FUNCTION SPLIT_2 COMPILE PLSQL_CODE_TYPE=INTERPRETED REUSE SETTINGS;
DECLARE
strings ARR_vARCHAR_100 := arr_varchar_100();
ln_n1 NUMBER;
ln_n2 NUMBER;
lv_plsql_type VARCHAR2(100);
BEGIN
SELECT PLSQL_CODE_TYPE INTO lv_plsql_type FROM USER_PLSQL_OBJECT_SETTINGS WHERE NAME = 'SPLIT_2';
ln_n1 := dbms_utility.get_cpu_time;
FOR i IN 1..20000000
LOOP
strings := SPLIT_2('2000,2,123553168,1,10,64895,65535,27662,64860,64895,65535,27662,64860,0,,,,,,0,0,2491039806,,,,,,,,,0,0,1,,2491039106,,,,,,,,,,,,');
null;
END LOOP;
ln_n2 := dbms_utility.get_cpu_time;
DBMS_OUTPUT.PUT_LINE(lv_plsql_type||' : ' ||(ln_n2-ln_n1));
END;
INTERPRETED : 81848
Second Test :
ALTER FUNCTION SPLIT_2 COMPILE PLSQL_CODE_TYPE=NATIVE REUSE SETTINGS;
Same plsql block has run.
NATIVE : 80597
Did I a mistake ?
Thanks for responses.