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

introduce a micro stdlib for testing #3531

Merged
merged 6 commits into from
Jun 16, 2022
Merged

introduce a micro stdlib for testing #3531

merged 6 commits into from
Jun 16, 2022

Conversation

kustosz
Copy link
Contributor

@kustosz kustosz commented Jun 15, 2022

Pull Request Description

This introduces a tiny alternative to our stdlib, that can be used for testing the interpreter. There are 2 main advantages of such a solution:

  1. Performance: on my machine, runtime-with-intstruments/test drops from 146s to 65s, while runtime/test drops from 165s to 51s. >6 mins total becoming <2 mins total is awesome. This alone means I'll drink less coffee in these breaks and will be healthier.
  2. Better separation of concepts – currently working on a feature that breaks all enso code. The dependency of interpreter tests on the stdlib means I have no means of incremental testing – ALL of stdlib must compile. This is horrible, rendered my work impossible, and resulted in this PR.

Important Notes

Checklist

Please include the following checklist in your PR:

  • The documentation has been updated if necessary.
  • All code conforms to the
    Scala,
    Java,
    and
    Rust
    style guides.
  • All code has been tested:
    • Unit tests have been written where possible.
    • If GUI codebase was changed: Enso GUI was tested when built using BOTH
      ./run ide dist and ./run ide watch.

- name: main
url: https://libraries.release.enso.org/libraries
libraries:
- name: Standard.Base
Copy link
Contributor

Choose a reason for hiding this comment

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

I really like the idea. But I think we should call it Micro.Base, so that it is even more obvious that the test is working with the reduced stdlib. Otherwise, I'm afraid that the name might be a source of confusion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right. Gonna go with Microstd tho, so that it's 8 characters and I don't have to fix offset-based tests :P

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@4e6 turns out I cannot do it – the name Standard is assumed in a bunch of places in the codebase, and the interpreter breaks without it. Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

I see. Let's live with another Standard.Base for now

Copy link
Contributor

Choose a reason for hiding this comment

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

Tracking issue to un-hardcode the interpreter https://www.pivotaltracker.com/n/projects/2539304/stories/182487649

@kustosz kustosz added the CI: Ready to merge This PR is eligible for automatic merge label Jun 16, 2022
@mergify mergify bot merged commit ec3fa32 into develop Jun 16, 2022
@mergify mergify bot deleted the wip/mk/test-stdlib branch June 16, 2022 10:25
@JaroslavTulach
Copy link
Member

Clever! Reminds me of my efforts to define minimal Java.

Once I suggested that runtime.jar shall carry a minimalistic library inside of itself to be usable as a standalone JAR. If we packaged this micro stdlib into the runtime.jar, I would have what I wanted!

@hubertp
Copy link
Contributor

hubertp commented Jun 16, 2022

Awesome!

mergify bot pushed a commit that referenced this pull request Jun 23, 2022
`AtomBenchmarks` are broken since the introduction of [micro distribution](#3531). The micro distribution doesn't contain `Range` and as such one cannot use `1.up_to` method.

# Important Notes
I have rewritten enso code to manual `generator`. The results of the benchmark seem comparable. Executed as:
```
sbt:runtime> benchOnly AtomBenchmarks
```
kazcw pushed a commit that referenced this pull request Jun 29, 2022
This introduces a tiny alternative to our stdlib, that can be used for testing the interpreter. There are 2 main advantages of such a solution:
1. Performance: on my machine, `runtime-with-intstruments/test` drops from 146s to 65s, while `runtime/test` drops from 165s to 51s. >6 mins total becoming <2 mins total is awesome. This alone means I'll drink less coffee in these breaks and will be healthier.
2. Better separation of concepts – currently working on a feature that breaks _all_ enso code. The dependency of interpreter tests on the stdlib means I have no means of incremental testing – ALL of stdlib must compile. This is horrible, rendered my work impossible, and resulted in this PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants