-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[kotlin2cpg] Partly revert #4187 #4512
Conversation
This PR partly reverts #4187. The change to `CompilerAPI.makeEnvironment` breaks sptests. We may want to revisit that change later as it was intented to improve performance. With publishing this PR here locally sptests runs fine again.
How do I reproduce the breaking issue you are referring to as sptest? Let me see how this can be fixed? This consumes too much of memory and CPU for large repo. As it tries to build the type information cache for every path that is being passed as first parameter. The list we are passing is basically path to each and every child folder of the given project folder. Which can be also achieved by passing only the root directory. |
I don't know if you have access to codescience sptests but I guess you don't. On https://github.com/ShiftLeftSecurity/springboot-kotlin-webgoat the kotlin compiler completely errors out when only the root dir is given and that results in no type information at all. |
@max-leuthaeuser Do you have a deadline you could set for how long you're willing to wait for an alternative fix that achieves both goals? At least we have the webgoat for Kotlin to test against while @pandurangpatil looks into a fix |
Its for a running POC where the customer waits for an update. I don't know how patient this customer is, sorry. Maybe @gacevedo can say more. |
And from my point of view: the optimization in #4187 has never been released to the customers anyway. So we don't lose anything there. But we might lose type information now which may result in many lost findings as the broken sptests indicate. We should aim for high precision first and performance second. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should aim for high precision first and performance second.
This is a good point, and the most important imo
So I merged this to unblock the POC. A PR to get a fixed version of the performance optimization is very welcome nevertheless. |
@DavidBakerEffendi @max-leuthaeuser I understand the importance of precision. At the same time in my humble opinion, we should have the failing use cases incorporated as unit tests. Otherwise, it becomes difficult to collaborate. This becomes very crucial while making any performance improvements. As the only way to make sure nothing is breaking is by running the unit test cases. |
@pandurangpatil |
This PR partly reverts #4187. The change to
CompilerAPI.makeEnvironment
breaks sptests. We may want to revisit that change later as it was intented to improve performance.With publishing this PR here locally sptests runs fine again.