That would create an extreme amount of garbage due to the temporary tables. And it makes a compelling case for them to pass the numerical spellID in that last parameter if it's truly random/unused. String manipulation can create excessive garbage if not done with a little care.
In a test of 1000 random GUIDs run through 100 times (for 100k parses):
Code:
return tonumber((select(5, strsplit("-", GUID))))
Took 118ms and created 80k of garbage.
Code:
local x = { strsplit("-", GUID) }
return tonumber(x[5])
Took 247ms and created 8335k of garbage.
Code:
local _,_,_,_,x = strsplit("-",GUID)
return tonumber(x)
Took 110ms and created 80k of garbage.
Code:
local x = GUID:match("(%d+)%-(%x+)$")
return tonumber(x)
Took 380ms and created 80k of garbage.
Code:
local x = GUID:match("^%d+%-%d+%-%d+%-%d+%-(%d+)")
return tonumber(x)
Took 127ms and created 38k of garbage.
Code:
local x = GUID:match("%d+%-%d+%-%d+%-%d+%-(%d+)%-%x+")
return tonumber(x)
Took 147ms and created 38k of garbage.
Unfortunately I can't post the testing code since these forums are throwing a CloudFlare blocked page when attempting to do so.