Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lua code improvements #282

Merged
merged 1 commit into from
Jul 25, 2024
Merged

Conversation

eolesinski
Copy link
Contributor

@eolesinski eolesinski commented Jul 15, 2024

This PR makes various improvements to the gen_bytecode.lua code:

  • removes extra variables
  • replaces function calls to string length with operator # (much faster)
  • replaces for loop string concatenation with lua "string buffer" idiom
  • replaces conditional with two digit, left-padding format specifier

Copy link
Collaborator

@maurermi maurermi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

T-ACK. This PR improves the code-practices in the Lua script which we use for our Lua performance benchmark. I have verified that the script works as expected using our local bench test, and also verified that the bytecode generated is the same as before.

This is ready to merge pending one change -- which is fixing the inconsistency of tabs / spaces in scripts/gen_bytecode.lua. Once this is changed I think this is good to go!

One further note, we have other lua scripts checked into this repository, and I think applying the same cleansing changes to those would be wise as well (and potentially would be good to include in this PR)

Signed-off-by: eolesinski <eo2454@columbia.edu>
Copy link
Collaborator

@maurermi maurermi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

T-ACK. Thanks for fixing the other lua files and the tab/space inconsistency. Looks like a good change to me

@maurermi maurermi merged commit 57e390a into mit-dci:trunk Jul 25, 2024
7 checks passed
@eolesinski eolesinski deleted the lua-improvements branch July 25, 2024 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants