I’m just trying to point out the mistakes you’re making in your benchmarks, yet you decide to call me aggressive for no reason at all. Such comments aren’t allowed on the forums and is considered disrespective, as you’re being half subjective.
– You aren’t performing enough requests (3 is not enough).
That doesn’t matter at all, since you are saving for different keys.
– Saving to same key results in DataStore throttling.
This is why I suggested that taking average isn’t a good option, since for me, it never throttled and another request 2 times took exactly 0.3 seconds.
Pcalling is an fairly expensive operation, and shouldn’t be used on benchmarks as it just adds unnecessary time.
Again, all the tests I’m doing and explain indicate otherwise. Data saves successfully, you are claiming otherwise and keep repeating that without further elaborating. Such saving is rather expected behaviour than a bug. You can’t save data to the same key under 6 seconds (usually), but there are no such limits to saving data under different keys.
You comment is accusing me of spreading false information, which are not false, at least not according to this famous post on Stack Overflow: Concatenation of strings in Lua - Stack Overflow.
I just saw your topic, and yes, the information you told was false, the stack overflow post was made 11 years ago and a newer article about optimization in Lua has came out, which explains those.
If you read the topic, which you clearly didn’t:
local string1 = “A”
string1 = string1 … “B” … “C” —> creates one string
local t = {“A”, “B”, “C”}
string1 = “”
for i, v in pairs(t) do
string1 = string1 … v —> results in a lot of strings
end
This one is correct:
local string1 = "A"
string1 = string1 .. "B" .. "C" ---> creates 2 strings
local t = {"A", "B", "C"} -- A,B,C are already created above,
-- therefore they won't be created again
string1 = "" -- 1 string "" created
for i, v in pairs(t) do
string1 ..= v ---> lua will not create any more strings
end
My post is not off topic, it is to the point as it clarifies that string concatenation is not so expensive as you say it.