diff --git a/ext/nokogiri/extconf.rb b/ext/nokogiri/extconf.rb index ee7c53297a1..3a548a90841 100644 --- a/ext/nokogiri/extconf.rb +++ b/ext/nokogiri/extconf.rb @@ -615,6 +615,9 @@ def do_clean # errors/warnings. see #2302 append_cflags(["-std=c99", "-Wno-declaration-after-statement"]) +# gumbo html5 serialization is slower with O3, let's make sure we use O2 +append_cflags("-O2") + # always include debugging information append_cflags("-g") @@ -956,7 +959,7 @@ def install end def compile - cflags = concat_flags(ENV["CFLAGS"], "-fPIC", "-g") + cflags = concat_flags(ENV["CFLAGS"], "-fPIC", "-O2", "-g") env = { "CC" => gcc_cmd, "CFLAGS" => cflags } if config_cross_build?