Use name values instead of strings when possible

MAXScript FAQ > How To Make It Faster > Use name values instead of strings when possible

Each use of a string literal requires creating a new string value.

PROBLEM CASE:

fn test = append "A" "B"
test() --returns "AB"
test() --returns "ABB" 

TEST CASE:

fn test6 v = ()

FOR 100,000 ITERATIONS:

test6 "A" -- 125 msec.
test6 #a  -- 16 msec.

Previous Tip

Use StringStream to build large strings

Next Tip

Try not to use Execute function if there is an alternative