The Boston Diaries

The ongoing saga of a programmer who doesn't live in Boston, nor does he even like Boston, but yet named his weblog/journal “The Boston Diaries.”

Go figure.

Tuesday, November 10, 2009

Perhaps an 80M script isn't that excessive …

Okay, I played around a bit with the Lua code from last night. Here, again, is the six minute run:

[spc]lucy:/tmp/lua>time lua -i show.lua
Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> dofile("default.lua")
> os.exit()

real    5m49.052s
user    5m43.279s
sys     0m0.577s
[spc]lucy:/tmp/lua>

show.lua is some code to display a given table, and it's only being used here to see if the code actually built the huge table up correctly.

Okay, six minutes. I'm not sure what prompted me to do the following, but I did it anyway:

[spc]lucy:/tmp/lua>time lua -i default.lua
Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> dofile("show.lua")
> os.exit()

real    0m12.354s
user    0m6.293s
sys     0m0.413s
[spc]lucy:/tmp/lua>

Oooohkaaaaay … what happend here? To make matters more interesting, it's repeatable. I load show.lua (at 1,101 bytes) first, and it takes six minutes. Load default.lua (the 80MB file) and it takes 12 seconds. And if I do it this way:

[spc]lucy:/tmp/lua>time lua
Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> dofile("show.lua")
> dofile("default.lua")
> os.exit()

real    0m16.130s
user    0m6.311s
sys     0m0.365s
[spc]lucy:/tmp/lua>

and it takes 16 seconds (only because it took me an additional four seconds to type the extra line of code).

Very weird.

Update Wednesday, February 3rd, 2010

It was a bug in Lua that has since been fixed.

Obligatory Picture

Trying to get into the festive mood this year

Obligatory Contact Info

Obligatory Feeds

Obligatory Links

Obligatory Miscellaneous

Obligatory AI Disclaimer

No AI was used in the making of this site, unless otherwise noted.

You have my permission to link freely to any entry here. Go ahead, I won't bite. I promise.

The dates are the permanent links to that day's entries (or entry, if there is only one entry). The titles are the permanent links to that entry only. The format for the links are simple: Start with the base link for this site: https://boston.conman.org/, then add the date you are interested in, say 2000/08/01, so that would make the final URL:

https://boston.conman.org/2000/08/01

You can also specify the entire month by leaving off the day portion. You can even select an arbitrary portion of time.

You may also note subtle shading of the links and that's intentional: the “closer” the link is (relative to the page) the “brighter” it appears. It's an experiment in using color shading to denote the distance a link is from here. If you don't notice it, don't worry; it's not all that important.

It is assumed that every brand name, slogan, corporate name, symbol, design element, et cetera mentioned in these pages is a protected and/or trademarked entity, the sole property of its owner(s), and acknowledgement of this status is implied.

Copyright © 1999-2024 by Sean Conner. All Rights Reserved.