[llvm-dev] MCJIT -- Poor run-time performance for Fibonacci example in LLVM 3.8.1

Riyaz Puthiyapurayil via llvm-dev llvm-dev at lists.llvm.org
Thu Jun 9 21:31:16 PDT 2016


We have been using LLVM 3.4 and are currently migrating to LLVM 3.8.1. We have been using the Old JIT and since it has been removed since 3.6, we have to use MCJIT. I find that run-time performance is very poor in 3.8.1 for the Fibonacci example in llvm/examples/fibonacci.cpp. Logs below for fib34 and fib381 for input values of 30 and 40. I first thought it could be that MCJIT compile time is slower, but as I increase the input value, fib381 gets slower and slower in run-time performance (almost 200X for an input value of 40). Any hints on what could be going wrong? TIA.

% time fib34 30
...
starting fibonacci(30) with JIT...
Result: 832040
0.008u 0.000s 0:00.01 0.0%      0+0k 0+0io 0pf+0w

% time fib34 40
...
starting fibonacci(40) with JIT...
Result: 102334155
0.427u 0.003s 0:00.44 95.4%     0+0k 0+0io 0pf+0w

% time fib381 30
...
starting fibonacci(30) with JIT...
Result: 832040
0.795u 0.001s 0:00.81 97.5%     0+0k 0+0io 0pf+0w
% time fib381 40
...
starting fibonacci(40) with JIT...
Result: 102334155
97.591u 0.006s 1:37.71 99.8%    0+0k 0+0io 0pf+0w

Compile command used for each version (Platform: Linux 2.6.32-504.16.2.el6.x86_64):

clang++ -std=c++11 fibonacci.cpp `llvm-config --cxxflags --ldflags --libs` -ldl -lpthread -lncurses -o fib381
clang++ fibonacci.cpp `llvm-config --cxxflags --ldflags --libs` -o fib34
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160610/8d291e80/attachment.html>


More information about the llvm-dev mailing list