Skip to content

Instantly share code, notes, and snippets.

@tekkub
Created July 22, 2008 04:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tekkub/640 to your computer and use it in GitHub Desktop.
Save tekkub/640 to your computer and use it in GitHub Desktop.
do
local mem = collectgarbage("count")
local s = "Hi"
for t=1,1000 do
x = function() print(s) end
end
ChatFrame1:AddMessage("Used: "..(collectgarbage("count") - mem))
end
do
local mem = collectgarbage("count")
local s = "Hi"
local t = "Hi again"
for t=1,1000 do
x = function() print(s) end
end
ChatFrame1:AddMessage("Used: "..(collectgarbage("count") - mem))
end
do
local mem = collectgarbage("count")
local s = "Hi"
local t = "Hi again"
for t=1,1000 do
x = function() print(s..t) end
end
ChatFrame1:AddMessage("Used: "..(collectgarbage("count") - mem))
end
-- Results:
-- 31.28125
-- 31.28125
-- 66.4375
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment