1.15.0 / 2023-05-15 #2878
flavorjones
announced in
Releases
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
1.15.0 / 2023-05-15
Notes
Ability to opt into system
malloc
andfree
Since 2009, Nokogiri has configured libxml2 to use
ruby_xmalloc
et al for memory management. This has provided benefits for memory management, but comes with a performance penalty.Users can now opt into using system
malloc
for libxml2 memory management by setting an environment variable:# "default" here means "libxml2's default" which is system malloc NOKOGIRI_LIBXML_MEMORY_MANAGEMENT=default
Benchmarks show that this setting will significantly improve performance, but be aware that the tradeoff may involve poorer memory management including bloated heap sizes and/or OOM conditions.
You can read more about this in the decision record at
adr/2023-04-libxml-memory-management.md
.Dependencies
Added
Encoding
objects may now be passed to serialization methods like#to_xml
,#to_html
,#serialize
, and#write_to
to specify the output encoding. Previously only encoding names (strings) were accepted. [#2774, #2798] (Thanks, @ellaklara!)malloc
for libxml2 memory management. For more detail, see note above oradr/2023-04-libxml-memory-management.md
.Changed
Schema.from_document
now makes a defensive copy of the document if it has blank text nodes with Ruby objects instantiated for them. This prevents unsafe behavior in libxml2 from causing a segfault. There is a small performance cost, but we think this has the virtue of being "what the user meant" since modifying the original is surprising behavior for most users. Previously this was addressed in v1.10.9 by raising an exception.Fixed
XSLT.transform
now makes a defensive copy of the document if it has blank text nodes with Ruby objects instantiated for them and the template usesxsl:strip-spaces
. This prevents unsafe behavior in libxslt from causing a segfault. There is a small performance cost, but we think this has the virtue of being "what the user meant" since modifying the original is surprising behavior for most users. Previously this would allow unsafe memory access and potentially segfault. [#2800]Improved
Nokogiri::XML::Node::SaveOptions#inspect
now shows the names of the options set in the bitmask, similar toParseOptions
. [#2767]#inspect
and pretty-printing are improved forAttributeDecl
,ElementContent
,ElementDecl
, andEntityDecl
.ObjectSpace.memsize_of
reports a pretty good guess of memory usage when called onNokogiri::XML::Document
objects. [#2807] (Thanks, @etiennebarrie and @byroot!)config.guess
andconfig.sub
that supports new architectures likeloongarch64
. [#2831] (Thanks, @zhangwenlong8911!)xlink:arcrole
and removingxml:base
[#2841, #2842]<hr>
in<select>
[whatwg/html#3410, whatwg/html#9124]Node#first_element_child
now returnsnil
if there are only non-element children. Previously a null pointer exception was raised. [#2808, #2844]Nokogiri::XSLT
now has usage examples including custom function handlers.Deprecated
Nokogiri::XML::Node
as the first parameter toCDATA.new
is deprecated and will generate a warning. This parameter should be a kind ofNokogiri::XML::Document
. This will become an error in a future version of Nokogiri.Nokogiri::XML::Node
as the first parameter toSchema.from_document
is deprecated and will generate a warning. This parameter should be a kind ofNokogiri::XML::Document
. This will become an error in a future version of Nokogiri.Nokogiri::XML::Node
as the second parameter toText.new
is deprecated and will generate a warning. This parameter should be a kind ofNokogiri::XML::Document
. This will become an error in a future version of Nokogiri.nokogiri
namespace is deprecated and will generate a warning. Support for non-namespaced functions will be removed in a future version of Nokogiri. (Note that JRuby has never supported non-namespaced custom XPath functions.)Thank you!
The following people and organizations were kind enough to sponsor @flavorjones or the Nokogiri project during the development of v1.15.0:
We'd also like to thank @github who donate a ton of compute time for our CI pipelines!
sha256 checksums:
This discussion was created from the release 1.15.0 / 2023-05-15.
Beta Was this translation helpful? Give feedback.
All reactions