Ahmed Samy df3546b073 lua: now we have a function to static allocate an array
lua_newtable() definition:
	#define lua_newtable(L) 	lua_createtable(L, 0, 0)

This simply allocates space for 0 fields, meaning, if we push any
values into this array, it will re-allocate the array, which is bad.

This function statically allocates an array, so it's ready to have
X fields into it.

Performance tests:

lua_newtable
1428161
1426992
1413513

lua_createtable
2004544
1974117
1957533

These tests were done on an AMD 8350fx CPU, single thread used.

narr: This is for fields that just have an index, e.g. arr[0] etc.
nrec: For fields which needs like arr.a, arr.b etc.

This is how many times each of the functions can run per second, as
you can see about 1.7x the calls to lua_newtable.

All credits goes to @dalkon, he was too lazy to do it by himself, and
asked me to do it for him.
2013-12-21 16:13:24 +02:00
..
2013-11-13 14:33:29 -02:00
2013-12-01 00:48:36 -02:00
2013-11-30 23:08:43 -02:00
2013-01-27 23:23:53 -02:00
2013-02-28 12:19:42 -03:00
2013-12-15 19:09:03 +01:00
2013-11-10 20:35:00 -02:00
2013-03-05 20:33:27 +13:00
2013-12-15 19:09:03 +01:00
2013-12-01 01:30:48 -02:00
2013-11-30 23:34:21 -02:00
2013-11-13 13:55:34 -02:00
2013-01-08 16:32:05 -02:00