memory efficiency?
The mod I'm currently working on will pass a table with a "type" variable to a function. the function will check the "type" to see what variables are contained in the table.
I think that if 'type' is numbeirc rather than string, it should result in less memory consumed. But does it actually makes a difference? Or the impact is so neglible that I can just use string on 'type' so that it's more human readable?
What I meant was:
COMBAT_HIT = 103;
if result.type == COMBAT_HIT then bla bla bla
VS
if result.type == "COMBAT_HIT" then bla bla bla
Do they make a difference on memory?, if this is called frequently?
I did make a simple test myself, and it seems that the difference is negliable?
|