-
Notifications
You must be signed in to change notification settings - Fork 522
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
Performance drop for pefile.PE() #420
Comments
This performance hit is caused by 91fb851; every time |
@erocarrera In case it helps with confirmation/verification: # perftest.py
import sys
import time
import numpy.core
import pefile
import numpy as np
mode = sys.argv[1] if len(sys.argv) > 1 else 'binary'
if mode == 'binary':
# Test with valid PE file
file = numpy.core._multiarray_umath.__file__
else:
# Test with non-PE file
file = numpy.core.__file__
print(f"Test file: {file}")
durations = []
for i in range(10000):
time_start = time.time()
try:
with pefile.PE(file, fast_load=True) as pe:
pass
except Exception:
pass
elapsed = time.time() - time_start
durations.append(elapsed)
print(f"Total: {np.sum(durations):.2f} sec")
print(f"Mean: {1000*np.mean(durations):.4f} msec") Running with pefile
Running with pefile
Running with
|
@erocarrera I can confirm it's the garbage collection: |
Also seeing a huge performance drop when freezing via |
Hi!
After upgrading from
2023.2.7
to2024.8.26
the calls topefile.PE()
done bypyinstaller==6.10.0
take considerably longer on a Windows github action runner.This is observed in
pyinstaller
's "Performing binary vs. data reclassification" step, which takes orders of magnitudes longer now.logs:
2023.2.7
: https://github.com/MannLabs/alphapeptdeep/actions/runs/10524645976/job/29161830971"reclassification" step takes 3s
rerunning the same exact job through the github UI today pulled the latest version of
pefile
:2024.8.26
: https://github.com/MannLabs/alphapeptdeep/actions/runs/10524645976/job/29307704805(reclassification step is still in progress at time of writing this ;-))
similar job with some extra debug logs in
pyinstaller
(proof that is the actual call topefile.PE()
for each single file):https://github.com/MannLabs/alphapeptdeep/actions/runs/10578467189/job/29308669020
similiar job with downgrade to
pefile==2023.2.7
(proof that2024.8.26
is the root cause):https://github.com/MannLabs/alphapeptdeep/actions/runs/10578920267/job/29310144178
happy to share any more details if required..
best,
Magnus
The text was updated successfully, but these errors were encountered: