Skip to content

solo.read_TNR()/SolO QLI: Function is slow, and speed scales badly with amount of data #140

Description

@ErikPGJ

Step 1: Latest code?

  • [ X] This issue is present in the most recent code (i.e. after running git pull this is still a problem).
    Should be present in latest commit on devel branch: b679b71a Erik P G Johansson (2024-04-08 12:46:41 +0200)

Step 2: Describe your environment

  • irfu-matlab branch (e.g. master, devel): devel
  • Matlab version used (e.g. Matlab R2020b): MATLAB R2023b
  • Operating system (e.g. Windows 10, Mac OS X 10.15.6, Linux Ubuntu 20.04): Ubuntu 22.04.4 LTS
  • [X ] A 64-bit installation of Matlab was used.

Step 3: Describe the problem

solo.read_TNR() appears to have performance issues. Wall time spent in function increases faster than linearly with length of time interval of data used for it (the argument).

image

Steps to reproduce:

Simple code for visualizing behaviour.

%
% NOTE: Must mount /data/solo/ first. SolO DB fails without error if directories
% are not available.
%
% NOTE: May have to account for caching of (mounted/non-mounted) CDF files. SolO
% DB also has its own caching(?).
%
function read_TNR___speedTest
  tic
  close all

  solo.db_init('local_file_db', '/data/solo/');
  solo.db_init('db_cache_size_max', 4096)   % Unit: MiB.
  solo.db_cache('on', 'save')

%  N_SEC_ARRAY = 86400 * logspace(log10(0.1), log10(1), 5);
  N_SEC_ARRAY = 86400 * [0.2, 0.5, 1, 2, 3];

  for i = 1:numel(N_SEC_ARRAY)
    nSec         = N_SEC_ARRAY(i);
    tWallTimeSec = measure_read_TNR_walltime(nSec);
    
    fprintf('i            = %i\n', i)
    fprintf('nSec         = %g\n', nSec)
    fprintf('tWallTimeSec = %g\n', tWallTimeSec)

    nSecArray(i)         = nSec;
    tWallTimeSecArray(i) = tWallTimeSec;
  end

  plot(nSecArray/86400, tWallTimeSecArray, 'o-')
  xlabel('Length of time interval with TNR data [days]')
  ylabel('Wall time [s]')
  grid on

  toc
end



function tWallTimeSec = measure_read_TNR_walltime(nSec)
  START_TIME = irf.time_array('2022-12-28T00:00:00.00Z');
  STOP_TIME  = START_TIME + nSec;

  READ_TNR_TINT = [START_TIME; STOP_TIME];

  t = tic();
  TnrData = solo.read_TNR(READ_TNR_TINT);
  tWallTimeSec = toc(t);
end

Metadata

Metadata

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions