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

More missing methods implemented in sjsonnet #227

Merged
merged 3 commits into from
Dec 10, 2024
Merged

More missing methods implemented in sjsonnet #227

merged 3 commits into from
Dec 10, 2024

Conversation

stephenamar-db
Copy link
Collaborator

  • Basically almost every missing methods
  • Also imported the most recent version of the c-jsonnet stdlib test file

@stephenamar-db stephenamar-db force-pushed the stdlib branch 2 times, most recently from 5e66e6d to c8662a8 Compare December 6, 2024 23:20
Copy link
Contributor

@JoshRosen JoshRosen left a comment

Choose a reason for hiding this comment

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

LGTM!

@stephenamar-db stephenamar-db merged commit 6e03591 into master Dec 10, 2024
1 check passed
@stephenamar-db stephenamar-db deleted the stdlib branch December 10, 2024 00:49
stephenamar-db pushed a commit that referenced this pull request Dec 12, 2024
…per char (#237)

This PR fixes a performance regression from #227 /
4c85bde which I overlooked in review:

When generalizing the optimized non-Pattern-based split code, that
commit introduced a `.substring()` on each character, producing tons of
garbage.

Instead, I think we can do a `.startsWith(splitPattern, i)`: this should
be much faster because it will avoid unnecessary garbage string creation
(plus I'm pretty sure that `startsWith` is optimized in modern JDKs).

I also removed the use of `breakable` and replaced it with an update to
the `while` condition.
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