booleans should be stored with (at the most) 1 byte each, instead of 4 bytes each, then often saving a lot of intermediate memory
Reported by Samuel GOUGEON (@sgougeon)
BUG DESCRIPTION:
----------------
boolean matrices or hypermatrices are commonly used to
process filtered components. Then, these intermediate boolean
objects have the same sizes than their related parents ones.
These sizes can be huge.
Ideally, a boolean should be stored in a single bit.
Presently (Scilab 5.4.1), it is stored in 4 bytes, so in a 32 bits object.
A middle-point storage could be to store booleans are int8 are:
1 byte for each.
This would already save a lot of intermediate memory in common
cases described above.
-->tf = (ones(100,100)==1);
-->in = int8(ones(100,100));
-->[n,s] = who('local');
-->s(find(n=="tf"))*8
ans =
40016.
-->s(find(n=="in"))*8
ans =
10024.
HOW TO REPRODUCE THE BUG:
-------------------------
tf = (ones(100,100)==1);
in = int8(ones(100,100));
[n,s] = who('local');
s(find(n=="tf"))*8
s(find(n=="in"))*8