lua-users home
lua-l archive

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


On Sat, Mar 7, 2009 at 11:35 PM, Vaughan McAlley <ockegheim@gmail.com> wrote:
> In World of Warcraft, GUIDs (globally unique identifiers) apply to
> every player, NPC, etc and are 64-bit integers. They arrive in the Lua
> engine as 18 byte strings like "0x000000000E3A67B2". This works quite
> well as you usually only need check for equality or use them as keys
> in a table. Many combat events per second arrive, each with source and
> destination GUIDs, spell names etc. Lua handles the strings
> efficiently, and (though it would be impossible to test) I don't
> imagine performance would be much faster if Lua handled 64-bit ints.
> Just my opinion though.

I believe this is made easier by caching. That is, If many addons did
not cache the GUID for relevant units then the repeated allocations
would probably show. Then again, I would not be surprised if the
engine itself cached surrounding units in some fashion.

-- 
-Patrick Donnelly

"One of the lessons of history is that nothing is often a good thing
to do and always a clever thing to say."

-Will Durant