Frozen sequences

new topic     » topic index » view thread      » older message » newer message

<FontFamily><param>Courier New</param>I just got this idea, and I want to here
some
opinions about it.


<FontFamily><param>Times New Roman</param>I understand that one problem with
sequences is that they support

dynamical memory allocation even when this is not required or

even wanted, since it slows down things.


What about creating a 'freeze' feature which turns ordinary

sequences into variable structures with a fixed size and

shape? Eight bytes could be reserved for all atoms in the

sequence, to avoid the need for reallocation of memory

if for instance an integer turns into floating point.


Note that only the structure of the sequnce is frozen, not

the values of its atoms, which can be changed as usual.


Any attempt to append, prepend or redifine the frozen

sequence in any way would result in an error and the program

would be terminated.


Of course, the sequence could also be unfrozen when

dynamic shrinking and growing is required again.


Would this speed things up, and if so; how much?



Best regards,


Tor Bernhard Gausen.




<nofill>

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu