You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While profiling, I noticed that most of the overhead in loading files actually comes from the pprint module used in logging. The following test demonstrates this by comparing the time it takes to load test files with and without logging.
importigor2.binarywaveimportigor2.packedimportloggingigor2_test_data_dir="path/to/igor2/tests/data/"ibw_file=igor2_test_data_dir+"mac-double.ibw"pxp_file=igor2_test_data_dir+"polar-graphs-demo.pxp"# ibw, logging enabledlogging.getLogger("igor2.struct").setLevel(logging.NOTSET)
%timeitigor2.binarywave.load(ibw_file)
# 6.81 ms ± 111 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)# ibw, logging disabledlogging.getLogger("igor2.struct").setLevel(logging.CRITICAL)
%timeitigor2.binarywave.load(ibw_file)
# 320 µs ± 5.69 µs per loop (mean ± std. dev. of 7 runs, 1,000 loops each)# pxp, logging enabledlogging.getLogger("igor2.struct").setLevel(logging.NOTSET)
%timeitigor2.packed.load(pxp_file)
# 249 ms ± 2.23 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)# pxp, logging disabledlogging.getLogger("igor2.struct").setLevel(logging.CRITICAL)
%timeitigor2.packed.load(pxp_file)
# 9.24 ms ± 65.7 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)
The time it takes to load the files without logging is significantly faster than with logging. Would it be possible to disable logging by default?
The text was updated successfully, but these errors were encountered:
Interesting, there are a lot of debug statements in that module. I guess logging.WARNING or logging.INFO would also be sufficient in this case. I am happy to merge a PR with a fix.
While profiling, I noticed that most of the overhead in loading files actually comes from the
pprint
module used in logging. The following test demonstrates this by comparing the time it takes to load test files with and without logging.The time it takes to load the files without logging is significantly faster than with logging. Would it be possible to disable logging by default?
The text was updated successfully, but these errors were encountered: