Strings
Posted: Sun Jul 22, 2007 7:15 pm
Strings are past as parameters to procedures by value, which is good but time consuming.
It would be better (faster) if a pointer to the original value was used internally as long as the procedure would not try to change this value, while this pointer would point to the new value if the procedure tried to change it.
This would significantly speed up for example the use of Val?() on data containing millions of strings, while in most cases it would make Len() a real alternative to MemoryStringLength().
It is not pretty to always pass pointers to strings as parameters to procedures for performance reasons, no matter whether you really want to change the contents of these strings or not...
It would be better (faster) if a pointer to the original value was used internally as long as the procedure would not try to change this value, while this pointer would point to the new value if the procedure tried to change it.
This would significantly speed up for example the use of Val?() on data containing millions of strings, while in most cases it would make Len() a real alternative to MemoryStringLength().
It is not pretty to always pass pointers to strings as parameters to procedures for performance reasons, no matter whether you really want to change the contents of these strings or not...