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

Fix performance on Ruby 3.0 #22

Merged
merged 1 commit into from
Jul 7, 2022

Conversation

Watson1978
Copy link
Contributor

The Makefile generated by extconf.rb has changed in Ruby 3.0.
Therefore, when using Ruby 3.0, the optimization flags are not set properly and it reduced the performance.

This patch will set optimization flags in compiling properly.

  • Here is Ruby 2.7 Makefile result:
CXXFLAGS = $(CCDLFLAGS) -g -O2 -std=c++1z -Wno-register  $(ARCH_FLAG)
  • Here is Ruby 3.0 Makefile result:
CXXFLAGS = $(CCDLFLAGS)  -std=c++1z -Wno-register  $(ARCH_FLAG)

This PR will fix #20 issue.

The Makefile generated by extconf.rb has changed in Ruby 3.0.
Therefore, when using Ruby 3.0, the optimization flags are not set properly and it reduced the performance.

This patch will set optimization flags in compiling properly.

- Here is Ruby 2.7 Makefile result:

```
CXXFLAGS = $(CCDLFLAGS) -g -O2 -std=c++1z -Wno-register  $(ARCH_FLAG)
```

- Here is Ruby 3.0 Makefile result:

```
CXXFLAGS = $(CCDLFLAGS)  -std=c++1z -Wno-register  $(ARCH_FLAG)
```

This PR will fix anilmaurya#20 issue.
@anilmaurya
Copy link
Owner

Thanks @Watson1978 for raising this PR, somehow I missed to notice this PR before.

Will review it sometime soon.

@anilmaurya anilmaurya merged commit 1c6795b into anilmaurya:master Jul 7, 2022
@Watson1978 Watson1978 deleted the fix-performance branch July 7, 2022 13:19
@anilmaurya
Copy link
Owner

Thank you @Watson1978 once again for sending this PR. 🏅

I released version 0.6.0 with your changes.

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.

Very slow on Ruby 3
2 participants