Skip to content

Apply some minor generator optimizations - #998

Open
john-h-kastner-aws wants to merge 1 commit into
mainfrom
minor-generator-optimizations
Open

Apply some minor generator optimizations#998
john-h-kastner-aws wants to merge 1 commit into
mainfrom
minor-generator-optimizations

Conversation

@john-h-kastner-aws

Copy link
Copy Markdown
Contributor

Issue #, if available:

Description of changes:

Signed-off-by: jkastner <jkastner@amazon.com>
/// get a purely arbitrary string constant with that maximum size
/// indicated by `bound`. May truncate a longer string in the pool to this
/// length.
pub fn arbitrary_string_constant_bounded(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is a behavior change in addition to optimization. The function now takes an arbitrary string from the constant pool and truncates it the max length. IMO this is good because it lets this get more variety while still drawing from the constant pool

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Isn't also generating fresh string constants from time to time also desirable?

/// list of EntityUIDs that exist as a non-`None` actions name for an action in
/// the schema.
pub actions_eids: Vec<ast::Eid>,
pub actions_euids: Vec<ast::EntityUID>,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We only ever used this for EntityUIDs, so this change is to construct it as those instead of as Eids

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