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

Avoid fork and spawn when --threads=1 and use that for CI #7397

Merged

Conversation

asterite
Copy link
Member

@asterite asterite commented Feb 9, 2019

This PR consists of two commits:

  • the first one improves the compiler by not forking/spawning at all when --threads=1 is passed. This is a general useful change because currently we are always spawning and forking for no reason in this case.
  • the second one changes the CI scripts to pass --threads=1 when compiling the compiler and specs. This avoids allocating a bit more memory because fork seems to require that (when changes happen memory is copied) and, as shown in [DO NOT MERGE] Let's debug the compiler in the CI #7395, this makes some existing PRs that are failing now pass.

Changing CI to --threads=1 doesn't change completion time a lot, or at all, because most of the time is spent running the thousands of specs we have.

This is obviously a change almost exclusive to let the CI handle bigger programs and spec suites. I'd like to eventually improve the compiler's performance and memory consumption but for now this is a bit hard. The best we can do right now is to make this change so the CI doesn't fail... it's mostly a problem that happens in CI because anyone with a more or less recent computer should be able to compile the compiler and all the specs just fine (I currently have a MacBook Pro Late 2013).

@asterite asterite force-pushed the feature/dont-spawn-with-threads-1 branch from 272f8e0 to b6c7b04 Compare February 9, 2019 12:57
@asterite asterite force-pushed the feature/dont-spawn-with-threads-1 branch from b6c7b04 to 3af4242 Compare February 9, 2019 13:41
bin/ci Show resolved Hide resolved
@asterite asterite added this to the 0.28.0 milestone Feb 9, 2019
@asterite asterite merged commit 4e0f731 into crystal-lang:master Feb 9, 2019
@asterite asterite deleted the feature/dont-spawn-with-threads-1 branch March 30, 2019 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants