diff --git a/CHANGELOG.md b/CHANGELOG.md index 0851f3114b3..36c03eae403 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,7 @@ This version of Nokogiri uses [`jar-dependencies`](https://github.com/mkristian/ ### Improved * Serialization of HTML5 documents and fragments has been re-implemented and is ~10x faster than previous versions. [[#2596](https://github.com/sparklemotion/nokogiri/issues/2596), [#2569](https://github.com/sparklemotion/nokogiri/issues/2569)] +* Parsing of HTML5 documents is ~90% faster thanks to additional compiler optimizations being applied. [[#2639](https://github.com/sparklemotion/nokogiri/issues/2639)] * `Document#canonicalize` now raises an exception if `inclusive_namespaces` is non-nil and the mode is inclusive, i.e. XML_C14N_1_0 or XML_C14N_1_1. `inclusive_namespaces` can only be passed with exclusive modes, and previously this silently failed. * Compare `Encoding` objects rather than compare their names. This is a slight performance improvement and is future-proof. [[#2454](https://github.com/sparklemotion/nokogiri/issues/2454)] (Thanks, [@casperisfine](https://github.com/casperisfine)!) * Avoid compile-time conflict with system-installed `gumbo.h` on OpenBSD. [[#2464](https://github.com/sparklemotion/nokogiri/issues/2464)] diff --git a/ext/nokogiri/extconf.rb b/ext/nokogiri/extconf.rb index 520ff0c31ba..9d0e9690b22 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") @@ -953,7 +956,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?