Of course this test isn't precise because it uses os.time(), but you can replace it with socket.gettime() * 1000 if you want a exact result. Also:

Quote :

It is good programming style to use local variables whenever possible. Local variables help you avoid cluttering the global environment with unnecessary names. Moreover, the access to local variables is faster than to global ones.

gear4 wrote:

I just meant I prefer shorter scripts because I can make it give me better performance in a shorter amount of time

If I understood that sentence correctly, you are saying that you prefer short scripts because you need less time to optimize?

gear4 wrote:

I prefer to do my work quickly so I get done with it quickly so I have more time to play other games like WoW and Skyrim

That is IMHO a bad idea, to get work done quickly so you can play games. Why do we even have an implementation if it wasn't made properly and might have bugs which weren't found? If you do work, do it good, not fast.

Of course this test isn't precise because it uses os.time(), but you can replace it with socket.gettime() * 1000 if you want a exact result.

still not precise enough, I want MS

UKnowMe? wrote:

Quote :

It is good programming style to use local variables whenever possible. Local variables help you avoid cluttering the global environment with unnecessary names. Moreover, the access to local variables is faster than to global ones.

such speed differencemuch slowglobal's aren't slow enough to be given a shitEDIT: I just noticed it's 0.xxxxxxx seconds; sorry for that. imagine it's *1000 so I don't have to upload another pic

UKnowMe? wrote:

gear4 wrote:

I just meant I prefer shorter scripts because I can make it give me better performance in a shorter amount of time

If I understood that sentence correctly, you are saying that you prefer short scripts because you need less time to optimize?

yep, because I can read most of them easier

UKnowMe? wrote:

gear4 wrote:

I prefer to do my work quickly so I get done with it quickly so I have more time to play other games like WoW and Skyrim

That is IMHO a bad idea, to get work done quickly so you can play games. Why do we even have an implementation if it wasn't made properly and might have bugs which weren't found? If you do work, do it good, not fast.

actually I have more things to do though just not mentioned. in those 16 hours, a total of 4 hours went towards bugtesting, every command, every event

That might be that there is not much difference, but I just tested it with math.rand. Now imagine an associative table with about 3000 entries, and each entry with a table as value. You want to iterate over it. I remember it got a lot faster when I used local copies.As an example:Some months ago (it was around March/April afaik) Park posted his Lua-Code in a password protected Gobby-Server. I don't know if you knew Park's Server, but it had a lot of commands. At the time I joined him scripting he used to iterate over the global table. We then changed it to iterate over a local copy, and the script got noticeable faster. And I think that's the point of using locals. It should give you a noticeable performance speed, not one in milliseconds. (I think before changing it the script took about 1.5s to execute, afterwards it was about 500ms I would say.)If I have time I'm gonna test your LuaJIT mod using Park's old server scripts, but for that I need multiple masterserver support.

Sure, I will give you a link to a closed source project... And as I mentioned: The value was a table, too, and these tables values were accessed and operations were done on these values. And one last thing: If you now things better, give a reason why it is better. Not just give a code and say "That's total bullshit, man". Proof why it is better to do something that way.

I made that entire "module", and I just made it as an example to show how cool and easy Lua can be. you don't have to share you stuff if you don't want, I'm not forcing you to. if you mean the source files, though, sveark published his source, and that's what made it possible to make this an almost 1:1 port. also, if you do share something with me, and you don't want me to share it with anyone else, then just tell me and I'll not share it (I expect the same from my old helpers with my closed-source anticheat and enhancement (now dead though) for Cube 2)

Last edited by gear4 on Tue Dec 03, 2013 12:19 pm; edited 1 time in total

Yep, I know it. And I didn't posted it anywhere. But gear4, I was talking about an associative table with associative tables as values, not indexed tables with a single number as value. And I'll test it asap, but I won't be using Park's code for a public server (better write my own one).

noticed that bug (friend's pc), but I did put a "note" in the commit log, saying "untested", and yes, my version does like socket, since my server uses socket to monitor internal calls. also, I don't have a Windows PC anymore to test, so I have to commit before testing