Details
-
Type:
Story
-
Status: Done
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: meas_base
-
Labels:
-
Team:Architecture
-
Urgent?:No
Description
DM-33325 added some monte carlo tests to meas_extensions_trailedSources and they are a disaster for macOS ARM CPUs.
On an old intel mac mini:
============================= slowest 5 durations ==============================
|
32.91s call tests/test_trailedSources.py::TrailedSourcesTestCase_18.823189933596083_5.042446276240214_52.688133441854_0.5272863678675188::testMonteCarlo
|
32.42s call tests/test_trailedSources.py::TrailedSourcesTestCase_18.824525959248994_3.690341720399934_12.706783496622066_80.0121374592317::testMonteCarlo
|
30.48s call tests/test_trailedSources.py::TrailedSourcesTestCase_18.778338539085038_3.712755610201576_77.74789748127772_8.918117596264874::testMonteCarlo
|
29.14s call tests/test_trailedSources.py::TrailedSourcesTestCase_19.632089387567788_4.363012829054862_13.575047038897603_39.65613368621441::testMonteCarlo
|
28.94s call tests/test_trailedSources.py::TrailedSourcesTestCase_18.978084668646876_0.541677473106708_34.88128456167191_52.19822420855503::testMonteCarlo
|
] ================= 161 passed, 21 warnings in 144.23s (0:02:24) =================
|
but on a M1 Pro mac:
============================= slowest 5 durations ==============================
|
213.96s call tests/test_trailedSources.py::TrailedSourcesTestCase_18.823189933596083_5.042446276240214_52.688133441854_0.5272863678675188::testMonteCarlo
|
209.18s call tests/test_trailedSources.py::TrailedSourcesTestCase_18.824525959248994_3.690341720399934_12.706783496622066_80.0121374592317::testMonteCarlo
|
185.70s call tests/test_trailedSources.py::TrailedSourcesTestCase_18.778338539085038_3.712755610201576_77.74789748127772_8.918117596264874::testMonteCarlo
|
176.01s call tests/test_trailedSources.py::TrailedSourcesTestCase_15.552399069150322_1.2533910548710816_24.737438752106133_87.04870569671161::testMonteCarlo
|
166.66s call tests/test_trailedSources.py::TrailedSourcesTestCase_19.701132323
|
================= 161 passed, 21 warnings in 652.78s (0:10:52) =================
|
It turns out that all the time is spent calling getMaskPlanes in the meas_base noise replacer:
try: |
# does it already exist? |
plane = mask.getMaskPlane(maskname) |
if self.log: |
self.log.debug('Mask plane "%s" already existed', maskname) |
except Exception: |
# if not, add it; we should delete it when done. |
plane = mask.addMaskPlane(maskname) |
self.removeplanes.append(maskname) |
Indicating that this is another example of DM-33478.
Replacing the try block with
if maskname in mask.getMaskPlaneDict(): |
fixes the problem since it avoids the C++ layer raising an exception.
Yes please!