Skip to content

Commit

Permalink
Re #1786 minor comments to push up the build
Browse files Browse the repository at this point in the history
  • Loading branch information
abuts committed Feb 12, 2025
1 parent 7469c96 commit 889b434
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions herbert_core/utilities/classes/@fast_map/fast_map.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
%key-value pairs, where keys are unit32 numbers and values are double.
%
% Initial purpose -- use it as the fast map for connecting run_id-s with
% IX_experiment number to maintan correspondence between IX_experiment
% IX_experiment number to maintain correspondence between IX_experiment
% number and pixel ID.
%
% The class is necessary because MATLAB containers.Map class is
Expand All @@ -13,7 +13,7 @@
% Further development and acceleration may be possible, including
% mexing and building wrapper around C++ map class.
%
% WARNING: intentianally disabled multiple reliability checks and
% WARNING: intentionally disabled multiple reliability checks and
% convenience properties in favour of access speed.
%
% See fast_map_vs_map_performance in test_herbert_utilities
Expand Down Expand Up @@ -56,7 +56,7 @@
optimized_ = false;
min_max_key_val_ = []; % minimal and maximal values of keys in the
% map. Used in building the the optimization indices
keyval_optimized_ = {}; % 1D cellarrsy, containing values in places
keyval_optimized_ = {}; % 1D cellarray, containing values in places
% of keys, used for fast access to the values instead of search
% within key array.
key_shif_;
Expand Down Expand Up @@ -87,7 +87,7 @@
end
function self = add(self,key,value)
% add or replace value , corresponding to the key.
% if there are no such key in the map, the key-vaue pair is
% if there are no such key in the map, the key-value pair is
% added to the map. If key is present, its current value is
% replaced by the new one.
key = uint32(key);
Expand Down Expand Up @@ -255,8 +255,12 @@
% Overloaded indexers. DESPITE LOOKING NICE, adding them makes fast_map
% 40-60 times slower even without using indexes itself. Disabled for this
% reason, until, may be mex is written which would deal with fast part
% of indices or we fully switch to MATLAB over 2021a, where you may
% overload subsagn using inheritance and specified abstract methods.
% of indices or we fully switch to MATLAB over 2021a, where you may
% overload subsasgn using inheritance and implemented abstract methods.
%
% fast_map_vs_map_performance settings : nkeys = 200,
% n_operations = 40000
%
% SAMPLE OF PERFORMANCE OF fast_map vrt MATLAB map (UINT map)
% subsref/subsasgn : enabled ! disabled
%Find & Add keys to UINT map takes: 108.82sec ! 106.53sec
Expand Down Expand Up @@ -310,7 +314,7 @@
methods
function ver = classVersion(~)
% define version of the class to store in mat-files
% and nxsqw data format. Each new version would presumably read
% and .sqw data format. Each new version would presumably read
% the older version, so version substitution is based on this
% number
ver = 1;
Expand Down

0 comments on commit 889b434

Please sign in to comment.