Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
From the Lua Power Patches page: "Use NaN packing for TValue on x86 to reduce memory usage and tiny performance gain (same as in LuaJIT i2). It's fully ABI compatible with standard Lua libraries. On one test script memory consumption reduced from 28Mb to 21Mb and performance improved about 3.5-5%" Added support for big endian architectures and LTR compatibility.
- Loading branch information
1 parent
c8b89a4
commit 1a5b04e
Showing
7 changed files
with
205 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1a5b04e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I'll have to do some testing with this one. Any initial observations?
1a5b04e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested on the simulator, on a LM3S and on an AVR32 with a couple of scripts (life and hangman). Seems to work fine. Not sure how much it actually helps, but it can't hurt.
1a5b04e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to make a difference on the low memory system I have here:
Running sieve.lua like this now works up to 1024 on a 32 kB platform where previously only up to 512 worked:
1a5b04e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow! That's quite something. I'm glad you can use this.
1a5b04e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's a comparison with and without the patch during the filling stage of this code:
1a5b04e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
life.lua also runs at 16x16 in 22.1 kB (as reported on the bottom line while running)
1a5b04e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could also check, how this patch landed at Lua 5.2 (in a bit more elegant way)
1a5b04e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I found this one good (and elegant) enough for my needs, thus I didn't even consider checking the Lua 5.2 way. I'll do that once I cleared some of the rest of the stuff I need to do.