Skip to content

More missing methods implemented in sjsonnet#227

Merged
stephenamar-db merged 3 commits intomasterfrom
stdlib
Dec 10, 2024
Merged

More missing methods implemented in sjsonnet#227
stephenamar-db merged 3 commits intomasterfrom
stdlib

Conversation

@stephenamar-db
Copy link
Copy Markdown
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
Comment thread sjsonnet/src/sjsonnet/Std.scala Outdated
Comment thread sjsonnet/src/sjsonnet/Std.scala Outdated
Copy link
Copy Markdown
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
@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