actually, it was a good way to measure the impact of securing a string, but not suficient to find out if a string is secure:
string a = String.secure("this is a short string"); gauge{ int i=100000000; while(i){ string b = "this is a short string"; b = 0; i--; } }; Result: 29.1494
this shows that setting a new string to the same value as a secure string doesn't make it secure.
it needs more cleverness.
but any trick like: string a = String.secure("this is a short string"); gauge{ int i=10000000; while(i){ string b = a+"this is a short string"; b = 0; i--; } }; Result: 20.7256
or even: gauge{ int i=10000000; while(i){ string b = a; b = 0; i--; } }; Result: 6.72067
didn't give any difference in measurement compared to:
string c = "this is a short string"; gauge{ int i=10000000; while(i){ string b = c+"this is a short string"; b = 0; i--; } }; Result: 20.709 or gauge{ int i=10000000; while(i){ string b = c; b = 0; i--; } }; Result: 6.72388
not clever enough...
(i made the loop shorter to not have to wait so long for the results, but i think the effects are the same)
greetings, martin.