Skip to content

Instantly share code, notes, and snippets.

@SahilPatidar
Last active October 9, 2024 07:10
Show Gist options
  • Save SahilPatidar/2191963e59feb7dfa1314509340f95a1 to your computer and use it in GitHub Desktop.
Save SahilPatidar/2191963e59feb7dfa1314509340f95a1 to your computer and use it in GitHub Desktop.

Test fibonacci recursive:

clang-repl> %lib testb/fib.dylib
clang-repl> #include<vector>
clang-repl> extern "C++" long long fibonacci_recursive(int n);
clang-repl> extern "C++" void print(long long v);
clang-repl> print(fibonacci_recursive(50));
Fib -> 12586269025

In-Process Execution:

Run Execution Time (User+System) Wall Time Instruction Count
1 110.3334 seconds 110.4501 816987748378
2 110.4541 seconds 110.4883 816999942524
3 110.2788 seconds 110.3627 816959594512
4 110.2889 seconds 110.2989 816967609678
5 110.2735 seconds 110.2712 816936507781
6 110.2844 seconds 110.2797 816938362477
7 110.2625 seconds 110.2578 816929599549
8 110.2727 seconds 110.3556 816954989573

Out-Of-Process Execution:

Run Execution Time (User+System) Wall Time Instruction Count
1 0.4826 seconds 110.4601 2246888147
2 0.4796 seconds 110.4397 2262147376
3 0.4859 seconds 110.3202 2262921683
4 0.5099 seconds 110.4193 2326261121
5 0.5153 seconds 110.4515 2330273536
6 0.4780 seconds 110.3198 2265569844
7 0.4997 seconds 111.1089 2292402773
8 0.4757 seconds 110.2585 2265191941

Summary Table

Metric In-Process Execution Out-Of-Process Execution
Min Execution Time (User+System) 110.2625 seconds 0.4757 seconds
Max Execution Time (User+System) 110.4541 seconds 0.5153 seconds
Average Execution Time (User+System) 110.3060 seconds 0.4908 seconds
Min Wall Time 110.2578 seconds 110.2585 seconds
Max Wall Time 110.4883 seconds 111.1089 seconds
Average Wall Time 110.3455 seconds 110.47225 seconds
Min Instruction Count 8,169,295,995,49 2,246,888,147
Max Instruction Count 8,169,999,425,24 2,330,273,536
Average Instruction Count 8,16,95,92,94,309 2,28,14,57,052

Head-to-Head Graphs:

1. Execution Time Comparison (In-Process vs. Out-Of-Process):

fibg1


2. Wall Time Comparison (In-Process vs. Out-Of-Process):

fibg2


3. Instruction Count Comparison (In-Process vs. Out-Of-Process):

fibg3


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