Skip to content

Commit 2b68678

Browse files
committed
Fix performance on Ruby 3.0
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.
1 parent c486824 commit 2b68678

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/fast_jsonparser/extconf.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
require 'mkmf'
2-
$CXXFLAGS += ' -std=c++1z -Wno-register '
2+
$CXXFLAGS += ' $(optflags) $(debugflags) -std=c++1z -Wno-register '
33

44

55
create_makefile 'fast_jsonparser/fast_jsonparser'

0 commit comments

Comments
 (0)