| 11 | */ |
| 12 | public class test_Setup { |
| 13 | public static void main(String[] args) { |
| 14 | |
| 15 | int join_column = 1; |
| 16 | int key_colnum = 10 - join_column; |
| 17 | int record_num = (int)Math.pow(2, 16);//65536 |
| 18 | |
| 19 | long time_JXT = 0; |
| 20 | long time_JXTp = 0; |
| 21 | long time_JXTpp = 0; |
| 22 | String condition = "";//used to choose different tables from dataset, e.g., "_14". |
| 23 | int circle_num = 10;//the run times, for one circle it takes about 30 s. |
| 24 | for (int j = 0; j < circle_num; j++) { |
| 25 | //System.out.println("------------- JXT ---------------"); |
| 26 | long setup_start_JXT = System.nanoTime(); |
| 27 | Setup_JXT table_JXT = new Setup_JXT(1, key_colnum, join_column, record_num, condition); |
| 28 | table_JXT.construct(); |
| 29 | long setup_end_JXT = System.nanoTime(); |
| 30 | time_JXT += setup_end_JXT - setup_start_JXT; |
| 31 | //System.out.println("JXT setup time : " + (setup_end_JXT - setup_start_JXT)/Math.pow(10, 6) + " ms"); |
| 32 | |
| 33 | //System.out.println("------------- JXT+ ---------------"); |
| 34 | long setup_start_JXTp = System.nanoTime(); |
| 35 | Setup_JXTp table_JXTp = new Setup_JXTp(1, key_colnum, join_column, record_num, condition); |
| 36 | table_JXTp.construct(); |
| 37 | long setup_end_JXTp = System.nanoTime(); |
| 38 | time_JXTp += setup_end_JXTp - setup_start_JXTp; |
| 39 | //System.out.println("JXT+ setup time : " + (setup_end_JXTp - setup_start_JXTp)/Math.pow(10, 6) + " ms"); |
| 40 | |
| 41 | //System.out.println("------------- JXT++ ---------------"); |
| 42 | long setup_start_JXTpp = System.nanoTime(); |
| 43 | Setup_JXTpp[] table_JXTpp = new Setup_JXTpp[1]; |
| 44 | table_JXTpp[0] = new Setup_JXTpp(1, key_colnum, join_column, record_num, ""); |
| 45 | table_JXTpp[0].construct(); |
| 46 | long setup_end_JXTpp = System.nanoTime(); |
| 47 | time_JXTpp += setup_end_JXTpp - setup_start_JXTpp; |
| 48 | //System.out.println("JXT++ setup time : " + (setup_end_JXTpp - setup_start_JXTpp)/Math.pow(10, 6) + " ms"); |
| 49 | } |
| 50 | System.out.println("JXT setup average time : " + time_JXT / Math.pow(10, 9 + circle_num / 10) + " s"); |
| 51 | System.out.println("JXT+ setup average time : " + time_JXTp / Math.pow(10, 9+ circle_num / 10) + " s"); |
| 52 | System.out.println("JXT++ setup average time : " + time_JXTpp / Math.pow(10, 9+ circle_num / 10) + " s"); |
| 53 | } |
| 54 | |
| 55 | } |