atomsSystemUpdate is slow
Reported by Alain Lamy
atomsDESCRIPTIONread.sci (18.28 KB, text/x-csrc)
Proposed new version of atomsDESCRIPTIONread.sci (scilab-5.5.2/modules/atoms/macros/atoms_internals)
BUG DESCRIPTION:
----------------
Updating Atoms system database is very slow.
Attached is an optimised version of "atomsDESCRIPTIONread.sci".
optimisation is achieved by :
- avoiding looping on all the input file lines
- avoiding calling regexp on each input file line
- additional minor changes
The result is a gain by a factor 3.6 on Windows 32 bits:
- 5.2.2 version: 256 sec
- optimised version: 71 sec
The results of atomsDESCRIPTIONread are identical between the 2 versions
(according to isequal)
NB:
- Not only the main function (atomsDESCRIPTIONread) has been modified.
- The structure of the code has been simplified (avoiding duplicated lines)