Skip to content

Commit

Permalink
Fix performance on Ruby 3.0
Browse files Browse the repository at this point in the history
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

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

This PR will fix anilmaurya#20 issue.
  • Loading branch information
Watson1978 committed Sep 6, 2021
1 parent c486824 commit 8d21e1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ext/fast_jsonparser/extconf.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'mkmf'
$CXXFLAGS += ' -std=c++1z -Wno-register '
$CXXFLAGS += ' $(optflags) $(debugflags) -std=c++1z -Wno-register '


create_makefile 'fast_jsonparser/fast_jsonparser'

0 comments on commit 8d21e1f

Please sign in to comment.