Comments (5)
The worst case time complexity is much much worse than what you suggest. It's polynomial at least, but it includes lots of additional factors, and #nodes
is most definitely included. Another factor is #fields + #capturedvariables
(which factors in worse than linearly). And virtual dispatch edges also play a role.
But fortunately we aren't really hitting the worst case, as we do lots of optimisations to improve the common case (without being able to completely shed the worst-case from a theoretical perspective). In the good case, I'd expect the total complexity to be about #nodes
. The number of sources and sinks definitely play a role as well, but the average time complexity is actually, much better than a simple linear scaling there, because we can share a lot of flow reachability calculation between a set of sources and a set of sinks.
from codeql.
If I were to reduce the worst-case complexity to depend on just a single variable n
being the size of the code base, then the complexity would be O(n^k)
where k
is just about 25, as far as I could count.
from codeql.
So that means if your code size grows 10 times bigger, there will be 10^25 more work?
Indeed, the worse case complexity is much much worse than I thought.
from codeql.
So that means if your code size grows 10 times bigger, there will be 10^25 more work?
Potential work in the worst case, yes, that's right (caveat, 25 might not be exactly right - it's a rough estimate based on a quick count). But again, the average case never really hits the worst case, so the typical experience is more like O(n)
.
Indeed, the worse case complexity is much much worse than I thought
Yes.
from codeql.
Actually, there are some safeguards in place, which I think might keep the worst-case bounded at O(n^7)
instead of O(n^25)
. But the theoretical complexity doesn't really matter much in practice anyway.
from codeql.
Related Issues (20)
- Insecure randomness - Documentation issue - Code example is misleading and could be improved HOT 4
- Python: Dataflow fails when Class attributes are accessed as Instance attributes. HOT 2
- [email protected]
- raw.githubusercontent.com/square/okhttp/master/samples/guide/src/main/java/okhttp3/guide/PostExample.java
- CodeQL XSS False Positive when using ESAPI.encoder().encodeForHTML() to defend against XSS HOT 1
- Python - unable to find suitable examples to iterate over objects HOT 8
- General issue
- CodeQL autobuild action doesn't work with reusable workflow HOT 1
- Use-After-Query.ql does not work on this simple situation HOT 2
- Use-After-Query.ql doesn't work on this simple situation
- False negative for JavaScript SQL injection HOT 7
- Organization-level CodeQL Query packs HOT 2
- Unable to resolve CodeQL SSRF warning for a HTTP request function that takes pip package names as input HOT 7
- How to write Metadata for queries to get Call Graph in JavaScript? HOT 4
- Https://GitHub.com/SOHEIL115/
- Lack of notifications HOT 1
- Text format HOT 1
- How to resolve LocalTypeAccess into TypeExpr in TypeScript? HOT 2
- Recursive type checking in TypeScript HOT 3
- General issue for CSharp| Is it possible to select a method call inside a method?
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 codeql.