-
-
Notifications
You must be signed in to change notification settings - Fork 626
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
degraded performance in 1.6.0 release #490
Comments
This commit adds a new command line argument to hide output when the result of the scan is passing with no warning/errors. The new option is -q or --quiet. It also allows --silent to be consistent with the GNU standard on CLI options [1]. [1] http://www.gnu.org/prep/standards/html_node/Option-Table.html#Option-Table Signed-off-by: Eric Brown <browne@vmware.com> Fixes Issue #384
I believe those two lines cause the performance decrease: bandit/bandit/formatters/text.py Lines 144 to 146 in 7c4b9fa
I will further investigate. |
The lines were introduced in 7c4b9fa and have two effects. First they cause `get_issue_list` to run twice and before the user receives feedback that bandit started running. Secondly it does not display any output if no issues are found, which is an unintended behavior change.
@ericwb I am cc-ing you here too, since you released 1.6.0. Maybe you have another hint why the performance decreased so drastically. You can see in figure 1 how big the impact is, after the update. |
Hi @codingjoe I just try to find the delay on the code and I cannot find any on the Text formatter. Could you share more information in order to find the root cause? When I run the line_profile using the example directory it not take delay.
|
@ehooo I am not so sure, it's the same problem, since the spike in run time only happens since version 1.6.0 not 1.5.x |
@codingjoe could you share more context to try to reproduce the issue? |
@ehooo no specific project, this seems to have affected all kinds of projects. |
I am affected by this issue, too. It seem not to be a general performance issue, but really a bug that makes Bandit collect a large amount of files to inspect.
Example:
Could it be that for some reason the excluded paths option has become defunct? |
* Fix #490 -- Fix performance issue introduced in 1.6.0 The lines were introduced in 7c4b9fa and have two effects. First they cause `get_issue_list` to run twice and before the user receives feedback that bandit started running. Secondly it does not display any output if no issues are found, which is an unintended behavior change. * add namespaces for parent attributes * pylint formatting changes * made bandit_parent a private attr * temporary fix; perf issue only on quiet * update perf issue
Hi again. I was working trying to find the root cause for that issue, but i think is affected just for some kind of code. The following code was used:
The results: On python 2.7 we could see the bottleneck on "fnmatchcase" But on 3.7 the only i could find the functions "isfile", "get_module_qualname..", and "_execute_ast_visit.." But i not sure that it is the root case. @bittner i think you issue is related with #488 Could someone give us some feedback to know if this case is solved on 1.6.1 or 1.6.2 version? |
Nope, I was immaturely excited :/ |
Why is this issue still closed? Shouldn't we reopen it? I'm still pinning Bandit to <1.6, because |
Bandit UX is seriously broken, only <1.6 works predictably. Exclude/ignore of files is currently broken in Bandit: - PyCQA/bandit#693 - PyCQA/bandit#490 - PyCQA/bandit#438 (comment) Reading settings from configuration files is broken: - PyCQA/bandit#753 - PyCQA/bandit#595 Reading from pyproject.toml not yet functional: - Must install "toml" package and use "-c pyproject.toml". - PyCQA/bandit#758 INI file configuration and CLI usage is unclear: - PyCQA/bandit#603 - PyCQA/bandit#467 - PyCQA/bandit#396
Bandit UX is seriously broken, only <1.6 works predictably. Exclude/ignore of files is currently broken in Bandit: - PyCQA/bandit#693 - PyCQA/bandit#490 - PyCQA/bandit#438 (comment) Reading settings from configuration files is broken: - PyCQA/bandit#753 - PyCQA/bandit#595 Reading from pyproject.toml not yet functional: Must install "toml" package and use "-c pyproject.toml". - PyCQA/bandit#758 INI file configuration and CLI usage is unclear: - PyCQA/bandit#603 - PyCQA/bandit#467 - PyCQA/bandit#396
Bandit UX is seriously broken, only <1.6 works predictably. Exclude/ignore of files is currently broken in Bandit: - PyCQA/bandit#693 - PyCQA/bandit#490 - PyCQA/bandit#438 (comment) Reading settings from configuration files is broken: - PyCQA/bandit#753 - PyCQA/bandit#595 Reading from pyproject.toml not yet functional: Must install "toml" package and use "-c pyproject.toml". - PyCQA/bandit#758 INI file configuration and CLI usage is unclear: - PyCQA/bandit#603 - PyCQA/bandit#467 - PyCQA/bandit#396
Describe the bug
I have seen a performance decrease in version 1.6.0. I a member of FussyFox and we run thousands of bandit checks a day. I see an increase in timeouts (200s limit) since I upgraded the stack to the 1.6.0 release.
My best guess, it's this commit 7c4b9fa
I will further investigate the issue.
The 200-second cap is because the sub process times out. The execution time would be even longer.
The text was updated successfully, but these errors were encountered: