Comments (3)
I've just played around with this a bit, but I was only able to get modest gains by parallelizing the rules.
For my sample app, just 25% of the time is spent applying the rules, but 75% of time is spent compiling.
I think it would be a lot more worthwhile to have one thread per file (including compilation) rather than per rule.
The downside is that, for full effect, the rules would either need to be thread-safe or each rule must be instantiated once per thread.
Experiment results
MacBook Pro 4x2.4 GHz (late 2011)
TotalFiles=94 FilesWithViolations=48 P1=0 P2=10 P3=127
5000 LOC, plus a bunch of CocoaPods dependencies
linear
- spike CPU usage: 100%
- wall time: 1:07
- CPU time: 1:02
rules parallel (8 threads)
- spike CPU usage: 160%-170%
- wall time: 0:53
- CPU time: 1:16
files parallel (8 threads)
- spike CPU usage: 700%
- wall time: 0:23
- CPU time: 1:44
from oclint.
Interestingly, dogfooding.sh actually fared much better with 2:43, 1:37, 1:16 wall time...
My sample project has a big prefix header. While this keeps compile times low in Xcode (where it is precompiled), it might have a negative effect on oclint (where it probably isn't).
from oclint.
@nschum, your observation is quite right. Currently, the performance bottleneck is the compilation time rather than the analysis time (unless the users have a huge rule set, but this is hardly true for now).
But in the future, when we have more rules and certain rules will require heavy analysis, so eventually the analysis time will be prominent.
I have taken a look at your pull request briefly, as always, very impressive quality code in high standard. Thank you for the help. I will get back to you in detail later.
from oclint.
Related Issues (20)
- undefined reference to std::_Sp_make_shared_tag::_S_eq(std::type_info const&) HOT 5
- Compile successfully but report has many compiler error but Xcode is Normal compilation success HOT 13
- lLVVM Error HOT 2
- project use MMKV lib could analyse error HOT 5
- How do I use the same compiler as Xcode? HOT 6
- what version are clang and llvm oclint version 22.02? HOT 2
- Crash on Xcode 14 when used via Fastlane HOT 2
- xcodebuild failed when use OCLint in Xcode HOT 6
- xcode14 not work HOT 3
- oclint doesn't work: a lot of compiler errors in oclint_result.html. Xcode 14.1 oclint 22.02 HOT 16
- sonar-reports/SonarDemo-oclint.xml' failed with error code: 6 HOT 2
- Request for enhancement: Upgrade OCLint to LLVM 15.0.7, moving away from the prior version, LLVM 13.0.0 HOT 2
- OClint on windows 10 HOT 2
- Please upgrade oclint to llvm14.0 HOT 16
- Feature request: adjust threshold for one function HOT 2
- oclint: error: compilation contains multiple jobs: OCLint 22.02 + MacOS Ventura 13.0 + XCode 14.3 HOT 11
- Xcode14.3,OCLint: 20.11 oclint: error: compilation contains multiple jobs: HOT 22
- high amount of RAM used HOT 2
- With the same compilation options, clang compiles successfully, but oclint encounters problems during compilation HOT 4
- Xcode 15, OCLint 22.02, oclint: error: compilation contains multiple jobs: HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oclint.