Skip to content

Conversation

@strtgbb
Copy link
Contributor

@strtgbb strtgbb commented Dec 6, 2024

Contributor License Agreement

For more information see https://github.com/testflows/TestFlows/blob/master/CONTRIBUTING.md.

You can electronically sign the CLA inside your first pull request using CLA Assistant by reading the CLA
and, when requested, sign it by adding a comment containing the following text.

I have read the CLA Document and I hereby sign the CLA

I, the Contributor, have agreed to and signed the CLA.

Description of Changes

Please describe here your proposed changes.

  1. Optimized single-character calls to startswith. Small performance improvement.
  2. Replaced startswith in fails.py transform with regex. Reduced run time of transform nice-new-fails by ~85%

before

time tfs transform nice-new-fails raw\(28\).log > /dev/null

real	0m13.005s
user	0m12.740s
sys	0m0.262s

after

time tfs transform nice-new-fails raw\(28\).log > /dev/null

real	0m1.919s
user	0m1.886s
sys	0m0.033s

@github-actions
Copy link

github-actions bot commented Dec 6, 2024

All Contributors have signed the CLA.
Posted by the CLA Assistant Lite bot.

@strtgbb
Copy link
Contributor Author

strtgbb commented Dec 6, 2024

I have read the CLA Document and I hereby sign the CLA

@strtgbb
Copy link
Contributor Author

strtgbb commented Dec 6, 2024

This PR also fixes the high memory consumption of nice-new-fails although I am not sure why.

@strtgbb
Copy link
Contributor Author

strtgbb commented Dec 6, 2024

If there's any chance that result can be an empty string, then my first optimization has introduced a bug. It's not the main contributor to the performance difference, so I can revert it or put it in a wrapper that catches the possible error.

@vzakaznikov vzakaznikov merged commit 6782ec7 into testflows:master Dec 11, 2024
1 check passed
@github-actions github-actions bot locked and limited conversation to collaborators Dec 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants