lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

I'd like to hear you "gut feelings" on three different ways to pass callback parameters to a Lua handler.

It's about a fairly large buffer (say, 4096 8-bit integers) that the Lua side would be interested to get. Now, candidates are:

a) table:
	+ conceptually "the right thing"
	- performance must be lowest?

b) ... (lots of integer values):
	+ fast to send, fast to receive
- is there a limit to the number of args one can get? is 10000 too many?

c) string:
+ fastest to send (no conversion, just cast Uint8 buffer to 'const char*') - fast to receive, but individual values need to be extracted by 'string.byte()'

So, which one would you opt? Eventually, I will do performance valuations & might post them here.

But.. who's got the right guts? :)