Skip to content
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

Parse file speed up #4000

Merged
merged 1 commit into from
Sep 29, 2023
Merged

Parse file speed up #4000

merged 1 commit into from
Sep 29, 2023

Conversation

cservakt
Copy link
Collaborator

@cservakt cservakt commented Sep 5, 2023

The feature can be useful to speed up the parse process when you want to parse one or more specified files. The VSCode Plugin also runs the 'parse --file' command, so the correction can solve the slow file verification problem. It uses metadata.json for plist mapping if the result_source_files section is not empty and contains the pairing of source files and plist files. Before the new feature, the process read all existing plist files to find the specified source file's reports.

@cservakt cservakt added WIP 💣 Work In Progress CLI 💻 Related to the command-line interface, such as the cmd, store, etc. commands performance 🏃 labels Sep 5, 2023
@cservakt cservakt added this to the release 6.23.0 milestone Sep 5, 2023
@cservakt cservakt requested a review from Szelethus September 5, 2023 08:27
@@ -392,7 +392,22 @@ def get_output_file_path(default_file_name: str) -> Optional[str]:

for dir_path, file_paths in report_file.analyzer_result_files(args.input):
metadata = get_metadata(dir_path)
for file_path in file_paths:

specified_file_paths = None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this variable is needed. file_paths could be assigned the new list if any.

] if 'tools' in metadata \
and len(metadata['tools']) > 0 \
and 'result_source_files' in metadata['tools'][0] \
else None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this result_source_files section is missing from metadata.json then we could fall back to the slow version by using file_paths again instead of giving no result due to this None value.

The feature can be useful to speed up the parse process when you want to parse one or more specified files. The VSCode Plugin also runs the 'parse --file' command, so the correction can solve the slow file verification problem.
It uses metadata.json for plist mapping if the result_source_files section is not empty and contains the pairing of source files and plist files. Before the new feature, the process read all existing plist files to find the specified source file's reports.
@cservakt cservakt removed the WIP 💣 Work In Progress label Sep 15, 2023
@bruntib bruntib merged commit 6d7351e into Ericsson:master Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI 💻 Related to the command-line interface, such as the cmd, store, etc. commands performance 🏃
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants