Hello, patch is very simple – utilizes dupstring's internal strlen to not call strlen again outside. Following test function: strtest() { a="" i=$(( 20000 )) while (( i -- )); do a+="aaaaaaaaaaaaaaaaaaaaaaaaa" done } runs for 1511 ms with optimizations, 1829 ms with no optimizations. Changing to i=$(( 10000 )) gives times 364 ms 414 ms, 50 ms difference (minimum obtainable times). -- Sebastian Gniazdowski psprint@fastmail.com