Skip to content

Instantly share code, notes, and snippets.

@SahilPatidar
Last active October 11, 2024 12:41
Show Gist options
  • Save SahilPatidar/c814634b2f863fc167b8d16b573f88ec to your computer and use it in GitHub Desktop.
Save SahilPatidar/c814634b2f863fc167b8d16b573f88ec to your computer and use it in GitHub Desktop.

Test Sorting 1:

clang-repl> %lib testb/sort.dylib
clang-repl> %lib testb/vec.dylib
clang-repl> #include<vector>
clang-repl> extern "C++" void print_n(std::vector<int> &v);
clang-repl> extern "C++" void selectionSort(std::vector<int>& arr);
clang-repl> extern "C++" std::vector<int> getArr(int limit);
clang-repl> std::vector<int> v = getArr(10000);
clang-repl> selectionSort(v);
clang-repl> print_n(v);

Out-of-Process Execution Timing Results

Total Execution Time Wall Clock Time User Time System Time Instructions (Instr)
0.5365 seconds 1.1075 seconds 0.4750 0.0615 2,378,045,965
0.5270 seconds 0.8993 seconds 0.4685 0.0585 2,385,812,705
0.5181 seconds 0.8050 seconds 0.4685 0.0496 2,356,077,917
0.5190 seconds 0.8111 seconds 0.4686 0.0503 2,353,927,360
0.5256 seconds 0.8242 seconds 0.4649 0.0607 2,360,305,858
0.5563 seconds 1.0177 seconds 0.4714 0.0849 2,449,793,051
0.5562 seconds 0.9962 seconds 0.4740 0.0822 2,429,939,399
0.5153 seconds 0.7908 seconds 0.4656 0.0497 2,360,662,119

In-Process Execution Timing Results

Total Execution Time Wall Clock Time User Time System Time Instructions (Instr)
0.8045 seconds 0.9271 seconds 0.7212 0.0834 4,592,766,533
0.7790 seconds 0.7892 seconds 0.7201 0.0589 4,533,485,579
0.7933 seconds 0.8890 seconds 0.7248 0.0685 4,554,886,124
0.7918 seconds 0.8111 seconds 0.7276 0.0641 4,528,650,981
0.7880 seconds 0.8765 seconds 0.7221 0.0659 4,552,121,057
0.8052 seconds 0.9079 seconds 0.7288 0.0764 4,557,214,484
0.7969 seconds 0.8869 seconds 0.7291 0.0678 4,549,406,639
0.7921 seconds 0.8701 seconds 0.7258 0.0662 4,553,136,659

Execution Time:

Execution_Time_Comparison

Wall Time:

Wall_Time_Comparison

Instruction Count:

Instruction_Count_Comparison



Test 2:

clang-repl> %lib testb/sort.dylib
clang-repl> %lib testb/vec.dylib
clang-repl> #include<vector>
clang-repl> extern "C++" void print_n(std::vector<int> &v);
clang-repl> extern "C++" void selectionSort(std::vector<int>& arr);
clang-repl> extern "C++" std::vector<int> getArr(int limit);
clang-repl> std::vector<int> v = getArr(100000);
clang-repl> selectionSort(v);
clang-repl> print_n(v);

Execution Timing Results

Execution Type Total Execution Time (seconds) Wall Clock Time (seconds) User Time (seconds) System Time (seconds) Instructions Executed
Out of Process
Run 1 0.5662 24.0833 0.4814 0.0848 2,437,788,404
Run 2 0.5466 23.9483 0.4762 0.0704 2,410,402,848
Run 3 0.5180 23.9062 0.4684 0.0496 2,358,855,717
Run 4 0.5166 23.8127 0.4671 0.0495 2,349,664,262
Run 5 0.5334 23.9170 0.4749 0.0585 2,374,365,829
Run 6 0.5250 23.8357 0.4735 0.0515 2,353,048,043
Run 7 0.5192 23.7977 0.4674 0.0518 2,352,838,151
Run 8 0.5097 23.7878 0.4615 0.0482 2,351,174,098
In Process
Run 1 23.7445 23.9699 23.5728 0.1717 213,256,419,341
Run 2 23.7451 23.8991 23.5880 0.1571 213,219,520,918
Run 3 23.7729 23.8475 23.5823 0.1906 213,206,894,242
Run 4 23.7274 23.7923 23.5781 0.1493 213,192,360,745
Run 5 23.7370 23.8810 23.5820 0.1549 213,213,141,168
Run 6 23.7336 23.8865 23.5783 0.1553 213,213,578,545
Run 7 23.7512 23.8929 23.5816 0.1696 213,217,514,533
Run 8 23.7576 23.8971 23.5870 0.1707 213,215,160,612

###Graph:

Execution Time:

Total_Execution_Time_Comparison

Wall Time:

Wall_Clock_Time_Comparison

Instruction Count:

Instructions_Executed_Comparison


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment