Do you remove the parentheses in methods?

On your remark about doing performance test, I would find it honestly surprising if there was a significant performance benefit over the other. Since it’s a purely syntactical difference.

If one was definitively faster than the other, than it might be beneficial to have the function calls with parentheses converted to ones without parentheses automatically. So we are gaining these performance benefits without needing to worry about code style anyway.

Of course, there could be things going on with Roblox’s Lua that I am not aware of.
But it sounds strange that there would be any significan’t performance increase between the two.

Lastly, I will say from my own experience that doing performance checks can be tricky to do right. Depending on the situation.
For one thing, you want to make sure that you are doing a benchmark on a large chunk of code that you know will take a considerable about of time. This will help reduce how the benchmarking code itself may affect your results. Because the benchmarking code takes time to execute as well. So you want that time to be a small fraction of the actual time result.

So if you are benchmarking a very simple operation (lets call it “Operation A”). Then it might be beneficial to run Operation A many many times for a single test. Because it can be more accurate to benchmark a “bulk test” like this.

So let’s say you run “Operation A” 10,000 times, and you time how long it takes to run all of that. Then you do the same thing for Operation B, where you run it 10,000 times and time it.
Then you can compare the times between the bulk operation of A and B. Then, if you want to get a sence of how much faster the one is compared to the other, you can calculate the percentage difference in time taken by calculating (B-A)/B
Where “B” and “A” are the benchmark times of the operations.

A negative result means B is faster than A, because it took less time.

But the point in explaining all that is because, a small percentage difference could be negligable.
Especially if somtimes when you run your benchmark, you may get varying results in your tests.
Which would mean that even if you get a benchmark that said “B takes 5% less time than A”, somtimes it might be 2% or -4% or 0%.
So you have to make sure by doing multiple tests that your results are precise, meaning each result consistently gives 5% difference.

But even then, if it is a 5% difference, you can think of that difference in terms of each individual operation. If you take your bulk times, and divide them by 10,000. You get the average time of each operation. That time could be in the range of microseconds (thousands of a milisecond).
So the conclusion would be that, you are getting a 5% time reduction on somthing that takes a very small amount of time anyway. The time reduction could be a couple microseconds.

Which in some cases could be good, but in others, it’s like trying to squeeze a lemon so hard that there is no more juice in it. It becomes incresingly hard to do that as you juice it more. So it becomes pointless trying to juice it even more.

But yea… :smile:
Just wanted to speak from my own experiences. Your results may appear like the one is faster, but it could be that the performance gains could be coming from somthing unrelated to the syntax, most likely. And if the speed gains are tiny, then it’s not a major concern. It’s better to try to get 20+% code time improvements, compared to 5% improvements.

I managed to find the old test I did and found out what caused the mistake: I tested it using a function that calculates things with the argument which affected the accuracy of the result and gave me incorrect readings

1 Like

What exactly about what they said in misinformation?
I did not thouroughly read everything, but it sounds like they are just speaking from their own findings.
And they are even retracting what they said and admitting there were errors, nothing wrong with that.

The only way this would be misinformation is if people didn’t bother to read this entire thread and only read their comments. Which nobody should really be doing.

This is the one of the furthest things from misinformation.
Misinformation requires the intent to decieve, which you are purely assuming based on fuzzy conclusions you’ve drawn in your own mind about them.

1 Like

alot of people read 1 post then ignore everything else dont spread information that you dont know is true (alot of people think pairs is better than next)

I did learn my lesson too, I’ll do my best to remember to re-test things from time to time and compare results so that if my previous test was incorrect I’ll know not to mention the result before I can confirm the testing method and result was correct

That’s not the fault of the person who concluded their information is correct aftering doing their own test and research, even if it was erroneous.
People shoudn’t be reading 5% of the information (forum) and assuming it’s correct. It’s the readers responsility to do plenty of research and their own tests to confirm what they are reading.

The reason there is so much false information (or misinformation) is because people don’t take eanough time to verify for themselves what they read.
And then they continue to spread that information assuming it’s true.

Like what you say about pairs and next. It’s likely most cases of people saying the wrong thing is because they just look at it as gospel and repeated it to other people without verifying.
That is spreading misinformation.