I am using GCC's -finline-limit=N compiler option. I am compiling my code and profiling it to check for reduction of CPU cycles. When I increase N, ideally, I should see a decrease in the number of cycles as larger functions get inlined. But I am seeing increase in the CPU cycles. Why is this happening?
Exact behavior of the -finline-limit GCC compiler option
2.2k Views Asked by Vinay At
1
There are 1 best solutions below
Related Questions in C
- How to call a C language function from x86 assembly code?
- What does: "char *argv[]" mean?
- User input sanitization program, which takes a specific amount of arguments and passes the execution to a bash script
- How to crop a BMP image in half using C
- How can I get the difference in minutes between two dates and hours?
- Why will this code compile although it defines two variables with the same name?
- Compiling eBPF program in Docker fails due to missing '__u64' type
- Why can't I use the file pointer after the first read attempt fails?
- #include Header files in C with definition too
- OpenCV2 on CLion
- What is causing the store latency in this program?
- How to refer to the filepath of test data in test sourcecode?
- 9 Digit Addresses in Hexadecimal System in MacOS
- My server TCP doesn't receive messages from the client in C
- Printing the characters obtained from the array s using printf?
Related Questions in PERFORMANCE
- Upsert huge amount of data by EFCore.BulkExtensions
- How can I resolve this error and work smoothly in deep learning?
- Efficiently processing many small elements of a collection concurrently in Java
- Theme Preloader for speed optimization in WordPress
- I need help to understand the time wich my simple ''hello world'' is taking to execute
- Non-blocking state update
- Do conditional checks cause bottlenecks in Javascript?
- Performance of sketch drastically decreases outside of the P5 Web Editor
- sample query for review for improvement on big query
- Is there an indexing strategy in Postgres which will operate effectively for JOINs with ORs
- Performance difference between two JavaScript code snippets for comparing arrays of strings
- C++ : Is there an objective universal way to compare the speed of iterative algorithms?
- How to configure api http request with load testing
- the difference in terms of performance two types of update in opensearch
- Sveltekit : really long to send the first page and intense CPU computation
Related Questions in INLINE-FUNCTIONS
- Is there a way to automatically "lift" function-like macros to real inline functions?
- C++ STL: The third parameter of sort(), why the functor is faster than inline function?
- inline keyword causes linker error in Clion
- Friend function not callable from template class operator overload
- Swap operation with inline function
- Is using an inline function a correct way of handling needing to access the same data from different structures given compile settings?
- Is the old meaning of the inline keyword deprecated in C++?
- How to deal with incompatibility in required language standards and/or extensions between different libraries?
- Confusion in Bjarne's PPP 2nd edition Pg. 316
- Should modifying an inline member function cause recompiling the whole class?
- Unresolved external symbol "enum days __cdecl operator++(enum days)" (??E@YA?AW4days@@W40@@Z) referenced in function main
- Will an inline function execute if you don't select it from the view?
- Include multiple inline functions and multiple CTEs in a WITH clause in a single query
- Can I inline a function which uses a static variable?
- How to compile C header with inline functions using g++11?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
There are multiple parameters (--param) for inlining in gcc. finline-limit uses some of them.
You can find the parameters here:
gcc optimize-options (search for max-inline-insns-single)
You can get some information on GCCs inline-heuristik from the sourcecode: ipa-inline-analysis.c (the comment at the top)
Note: Reducing function calls, branching etc. via inlining does not always reduce CPU cycles. Setting finline-limit to a large number can make things worse. Using
__attribute__ ((flatten))on functions can produce better results. All optimizing parameters can produce different results depending on your instruction sets and compiler version.