This article gives a summary of helpful techniques that you can use to improve CLion performance on large-scale projects.
And CLion uses a concept of a project and relies on CMake as a build system for it. All the includes paths, variables and more is taken from CMake files and are used by CLion to understand your project better and to resolve your code correctly. CLion is also available as a snap package. If you’re on Ubuntu 16.04 or later, you can install CLion from the command line. Sudo snap install clion -classic.
Increase memory heap
Enable memory indicators
You can check whether performance slowdowns are caused by low heap memory by monitoring two indicators in the bottom right corner of the status bar: the general Memory Indicator and the Clangd Memory Usage indicator.
Both indicators can be switched on/off from the status bar menu available on right click:
Increase heap in the Change Memory Settings dialog
Select Help Change Memory Settings from the main menu.
In the dialog that opens, set a higher memory heap value in the Maximum Heap Size field.
Click Save and Restart.
Increase memory heap from Toolbox
You can also change the heap size from the Toolbox app:
In Toolbox, select your CLion version and click the screw nut button on the right.
From the menu that opens, select Settings:
Go to the Configuration section and set a new value in the Maximum heap size field:
Another option to increase memory heap is to modify the corresponding JVM option,
Go to Help Edit Custom VM Options- this action will create a copy of the .vmoptions file in the IDE config directory and open it in the editor.
-Xmxto a higher value. For example,
-Xmx4096mfor 4 GB value instead of the default 2 GB.
CLion also warns you if the amount of the free heap memory is less than 5% of the maximum heap size:
Click Configure to edit
-Xmx in the Memory Settings dialog:
Change the memory value allocated for Clangd
Select Help Find Action from the main menu and search for Registry.
In the Registry dialog, start typing clion.clangd.max.memory.
Set the desired value and close the dialog.
Speed up code analysis
Tune analysis for a file
On-the-fly code analysis is one of the most performance-consuming processes in CLion. To lighten it up, you can configure the highlighting level for the currently opened file: none, errors only, or all problems. Use inspection widget in upper-right corner of the editor:
Toggle Power Save mode
As an alternative to configuring individual checks or files one by one, try Power Save Mode. It disables all inspections and other highly-consuming background tasks for the entire IDE.
To enable Power Save Mode call File Power Save Mode.
Check the Clangd-based engine
CLion incorporates a complementary Clangd-based language engine which is enabled by default. Currently, it works for error/warning annotation, certain navigation tasks, code formatting via ClangFormat, and code highlighting with quick-fixes.
In most cases, Clangd-based engine works faster than the built-in one (and sometimes provides more accurate results). However, it is not used for all operations. For example, Clangd provides the location for a quick-fix, while the fix itself is performed by the CLion’s own engine. Or, Find Usages employs Clangd to search through the files currently opened in the editor and the CLion’s own engine for all other usages.
We recommend you take Clangd engine specifics into account when investigating performance issues. Use Settings / Preferences Languages & Frameworks C/C++ Clangd to experiment with the engine settings and see if they affect the performance on certain tasks.
Speed up indexing
Exclude directories and file types
By default, CLion indexes all the directories listed in CMakeLists.txt (sources and
include_directories paths) for the purpose of correct resolve. Meanwhile, your project may contain folders with binaries, logs, or build artifacts, which do not affect CLion code insight. Also, indexing some folders can be too expensive due to their size or location. So it is reasonable to exclude such folders manually: right-click the directory in the project tree and choose Mark Directory as Excluded.
Since the symbols from the excluded files remain uncompleted for CLion, the following features are not available for such files: code completion and auto-import (except for the case when the excluded directory is marked with
include_directories in CMakeLists.txt), code generation, Find in Files (except for the scope of the currently opened files), navigation, and refactorings.
If you are working in remote development mode, the directories you mark as excluded will not be synchronized with the remote machine. See Full remote mode: excluded paths.
Another way to eliminate files like logs or generated data from indexing is to exclude them by file type in Settings/Preferences Editor File Types:
Work with smaller CMake sub-projects
The scope of files being parsed is determined by the loaded CMake script. So if your project is split into several subdirectories with self-contained CMakeLists.txt in each of them, you can load smaller sub-projects separately (for this, run Load CMake project on sub-CMakeLists.txt):
Another alternative for the case when you need to explore only a part of a big project is to create a compilation database, reduce it to the part of interest, and then open as a project in CLion.
Eliminate heavy parsing with the _CLION_IDE__ macro
IDE freezes may happen during the parsing of intricate preprocessor macros. To eliminate such problematic definitions from your code, replace them with some dummy ones using the
This macro affects parsing only, and it is undefined when you build or run your code.
Disable unnecessary plugins
To increase the IDE performance, try disabling the plugins you don't need. You will always be able to turn them on again later.
For example, if you are using a particular testing framework, consider disabling the plugins for other testing frameworks supported in CLion.
Go to Settings/Preferences Plugins.
Browse the Installed tab and disable the unnecessary plugins:
You can also disable all manually installed plugins at once (the non-bundled ones) from the menu under :
Report performance problems
If you experience an IDE freeze or high CPU/memory usage, and the tips listed above do not help, please provide us with the IDE logs, thread dumps, and snapshots. See this instruction for details on how to retrieve and send them.
IntroductionFFTW is a Csubroutine library for computing the discrete Fourier transform (DFT)in one or more dimensions, of arbitrary input size, and of both realand complex data (as well as of even/odd data, i.e. the discretecosine/sine transforms or DCT/DST). We believe that FFTW,which is free software, should become the FFT library of choice for mostapplications.
The latest official release of FFTW is version 3.3.9,available from our download page. Version3.3 introduced support for the AVX x86 extensions, adistributed-memory implementation on top of MPI, and a Fortran 2003API. Version 3.3.1 introduced support for the ARM Neonextensions. See the release notes formore information.
The FFTW package was developed at MIT by Matteo Frigo and Steven G. Johnson.
Our benchmarks,performed on on a variety of platforms, show that FFTW's performanceis typically superior to that of other publicly available FFTsoftware, and is even competitive with vendor-tuned codes. Incontrast to vendor-tuned codes, however, FFTW's performance isportable: the same program will perform well on mostarchitectures without modification. Hence the name, 'FFTW,' whichstands for the somewhat whimsical title of 'Fastest FourierTransform in the West.'
Subscribe tothe fftw-announcemailing list to receive release announcements (or use the web feed ).
FeaturesFFTW 3.3.9 is the latest official version of FFTW (refer to the release notes to find out what is new). Here is a list of some of FFTW's more interesting features:
- Speed. (Supports SSE/SSE2/Altivec, since version3.0. Version 3.3.1 supports AVX and ARM Neon.)
- Both one-dimensional and multi-dimensional transforms.
- Arbitrary-size transforms. (Sizes with small prime factors arebest, but FFTW uses O(N log N) algorithms even for prime sizes.)
- Fast transforms of purely real input or output data.
- Transforms of real even/odd data: the discrete cosine transform(DCT) and the discrete sine transform (DST), types I-IV. (Version 3.0 or later.)
- Efficient handling of multiple, strided transforms. (This lets youdo things like transform multiple arrays at once, transform onedimension of a multi-dimensional array, or transform one field of amulti-component array.)
- Parallel transforms: parallelizedcode for platforms with SMP machines with some flavorof threads(e.g. POSIX) or OpenMP. An MPI version for distributed-memory transforms isalso available in FFTW 3.3.
- Portable to any platform with a C compiler.
- Documentation in HTML and other formats.
- Both C and Fortran interfaces.
- Freesoftware, released under the GNU General Public License (GPL, see FFTW license).(Non-free licenses may also be purchased from MIT, for users who do not want their programs protected bythe GPL. Contact us for details.) (See also the FAQ.)
If you are still usingFFTW 2.x, please note that FFTW 2.x was last updated in 1999and it is obsolete. Please upgrade to FFTW 3.x. The API of FFTW 3.xis incompatible with that of FFTW 2.x, for reasons ofperformance and generality (seethe FAQorthe manual).
DocumentationFirst, read the FFTW Frequently Asked Questionsdocument.
Manual: HTML or PDF.
man pages:the fftw-wisdom and fftw-wisdom-to-conf utilities.
For general questions about Fourier transforms, see our links to FFT-related resources. People often askus how to compute a subset of the FFT outputs, so we have posted ashort discussion of pruned FFTs.
We benchmarked FFTW against many other FFT programs, in one tothree dimensions, on a variety of platforms. You can view the resultsfrom this benchmark, or download it to run on your own machine andcompiler, at the benchFFT webpage.
An audio interview of the FFTW authors is available from the RCE podcast program.
DownloadingVersions 3.3.9 and 2.1.5 of FFTW may be downloaded from this site. Feel free to postFFTW on your own site, but be sure to tell us so that we can link toyour page and notify you of updates to the software.
- BibTeX file of FFTW references.
- The most current general paper about FFTW, and the preferred FFTWreference: Matteo Frigo and Steven G. Johnson,'The Design and Implementation ofFFTW3,' Proceedings of the IEEE93 (2),216–231 (2005). Invited paper, Special Issue on ProgramGeneration, Optimization, and Platform Adaptation. [Link is toour preprint of published article; alsoin Postscript. Official issueis here.]
- ImplementingFFTs in Practice, our chapter in the online book Fast FourierTransforms edited by C. S. Burrus.
- 'A Fast Fourier Transform Compiler,' byMatteo Frigo, in the Proceedings of the 1999 ACM SIGPLAN Conference onProgramming Language Design and Implementation(PLDI '99), Atlanta,Georgia, May 1999. This paper describes the guts of the FFTW codeletgenerator. (Also in Postscript.The slides from the talk are alsoavailable.)
- An earlier (and somewhat out of date) paper on FFTW was publishedin the 1998 ICASSP conference proceedings (vol. 3, pp. 1381-1384) withthe title 'FFTW: An Adaptive SoftwareArchitecture for the FFT' (also in Postscript), by M. Frigo andS. G. Johnson.
- An even older technical report is 'The Fastest Fourier Transform in the West,'MIT-LCS-TR-728 (September 1997) (also in Postscript.).
- You might also be interested in 'Cache-ObliviousAlgorithms,' by M. Frigo, C. E. Leiserson, H. Prokop, andS. Ramachandran (FOCS '99).
- The slides from the 7/28/98 talk'The Fastest Fourier Transform in the West,' by M. Frigo, are alsoavailable, along with the slides froma shorter 1/14/98 talk on the same subject by S. G. Johnson.
- A paper on a new FFT algorithm that, following James Van Buskirk,improves upon previous records for the arithmetic complexity of theDFT and related transforms, is: Steven G. Johnson and Matteo Frigo,'A modified split-radix FFT with fewerarithmetic operations', IEEE Trans. Signal Processing55 (1), 111–119 (2007). Two preprints describing theapplication of the new algorithm to discrete cosine transforms are'Type-II/IIIDCT/DST algorithms with reduced number of arithmetic operations'(March 2007) and 'Type-IVDCT, DST, and MDCT algorithms with reduced numbers of arithmeticoperations' (August 2007), by X. Shao and S. G. Johnson.
FFTW receivedthe 1999J. H. Wilkinson Prize for Numerical Software, which is awardedevery four years to the software that 'best addresses all phases ofthe preparation of high quality numerical software.' Wilkinson was aseminal figure in modern numerical analysis as well as a key proponentof the notion of reusable, common libraries for scientific computing,and we are especially honored to receive this award in his memory.
Our paper 'A Fast Fourier Transform Compiler' (in PLDI 1999) receivedthe Most Influential PLDI Paper award in 2009.