Skip to content

Time overhead of Alazar measurements #113

@emartinez

Description

@emartinez

@jenshnielsen @ThorvaldLarsen @nataliejpg See below a profile of a measurement I am doing with the Alazar card. The bottomline is:

  • 126.496 s are spent acquiring, of which:
  • 96.024 s are spent at _call_dll (actual measurement time)
  • 12.384 s are spent at pre_start_capture, most of which is a call to demodulator.py:53(init)
  • 13.981 s are spent at post_acquire (mostly at sample_to_volt_u12 and demodulate)

For reference, a naïve implementation of the demodulation routine (a single matrix product) takes a couple hundred ms. Some suggestions for optimization are:

  • Call the Demodulator constructor in the AlazarChannel constructor instead of the acquisition code.
  • Optimize sample_to_volt_u12? It's not clear to me what exactly takes that long in that method.
  • Have a low-overhead alternative to Demodulator, for people who do not need the additional features.

1586515 function calls (1582362 primitive calls) in 138.488 seconds

Ordered by: cumulative time
List reduced from 1184 to 100 due to restriction <100>

ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 138.488 138.488 {built-in method builtins.exec}
1 0.003 0.003 138.488 138.488 :1()
1 0.013 0.013 138.486 138.486 scan.py:57(do2d)
42/40 0.000 0.000 126.577 3.164 parameter.py:252(call)
128/9 0.001 0.000 126.499 14.055 parameter.py:330(get_wrapper)
1 0.000 0.000 126.496 126.496 alazar_multidim_parameters.py:99(get_raw)
1 0.005 0.005 126.496 126.496 ATS.py:616(acquire)
211 96.024 0.455 96.024 0.455 ATS.py:915(_call_dll)
1 0.575 0.575 13.981 13.981 ATSChannelController.py:264(post_acquire)
1 1.254 1.254 13.405 13.405 ATSChannelController.py:295(handle_alazar_channel)
1 0.375 0.375 12.384 12.384 ATSChannelController.py:196(pre_start_capture)
1 9.690 9.690 11.986 11.986 demodulator.py:53(init)
138 9.091 0.066 9.091 0.066 {method 'commit' of 'sqlite3.Connection' objects}
112 0.002 0.000 8.151 0.073 sqlite_base.py:237(atomic_transaction)
2 0.004 0.002 7.287 3.644 measurements.py:184(flush_data_to_database)
2 0.000 0.000 7.284 3.642 data_set.py:357(add_results)
2 0.003 0.002 7.278 3.639 sqlite_base.py:397(insert_many_values)
1 0.000 0.000 7.163 7.163 measurements.py:287(exit)
1 0.026 0.026 5.597 5.597 ATSChannelController.py:366(_to_volts)
1 5.570 5.570 5.570 5.570 acq_helpers.py:4(sample_to_volt_u12)
1 4.288 4.288 5.400 5.400 demodulator.py:90(demodulate)
100 4.088 0.041 4.088 0.041 ATSChannelController.py:254(handle_buffer)
1 0.000 0.000 3.530 3.530 measurements.py:241(enter)
4 3.408 0.852 3.408 0.852 numeric.py:1076(outer)
4 0.000 0.000 2.708 0.677 data_set.py:241(add_parameter)
4 0.000 0.000 2.705 0.676 sqlite_base.py:1101(add_parameter)
161 0.001 0.000 1.865 0.012 sqlite_base.py:214(transaction)
161 1.742 0.011 1.864 0.012 {method 'execute' of 'sqlite3.Cursor' objects}
24 0.000 0.000 1.628 0.068 contextlib.py:85(exit)
56 0.000 0.000 1.628 0.029 {built-in method builtins.next}
46 0.000 0.000 1.628 0.035 sqlite_base.py:264(atomic)
2495 1.162 0.000 1.162 0.000 {method 'reduce' of 'numpy.ufunc' objects}
2 0.000 0.000 1.155 0.577 fromnumeric.py:2806(mean)
2 0.000 0.000 1.154 0.577 _methods.py:53(_mean)
4 0.000 0.000 1.081 0.270 sqlite_base.py:1140(_add_parameters_to_layout_and_deps)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions