nokogiri 1.13.6 → 1.14.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of nokogiri might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Gemfile +39 -0
- data/LICENSE-DEPENDENCIES.md +830 -509
- data/LICENSE.md +1 -1
- data/README.md +18 -11
- data/dependencies.yml +33 -15
- data/ext/nokogiri/extconf.rb +100 -24
- data/ext/nokogiri/gumbo.c +21 -11
- data/ext/nokogiri/html4_document.c +2 -2
- data/ext/nokogiri/html4_element_description.c +1 -1
- data/ext/nokogiri/html4_entity_lookup.c +2 -2
- data/ext/nokogiri/html4_sax_parser_context.c +1 -6
- data/ext/nokogiri/html4_sax_push_parser.c +1 -1
- data/ext/nokogiri/nokogiri.c +38 -51
- data/ext/nokogiri/nokogiri.h +26 -14
- data/ext/nokogiri/test_global_handlers.c +1 -1
- data/ext/nokogiri/xml_attr.c +3 -3
- data/ext/nokogiri/xml_attribute_decl.c +5 -5
- data/ext/nokogiri/xml_cdata.c +3 -3
- data/ext/nokogiri/xml_comment.c +1 -1
- data/ext/nokogiri/xml_document.c +23 -14
- data/ext/nokogiri/xml_document_fragment.c +1 -1
- data/ext/nokogiri/xml_dtd.c +9 -9
- data/ext/nokogiri/xml_element_content.c +3 -3
- data/ext/nokogiri/xml_element_decl.c +5 -5
- data/ext/nokogiri/xml_encoding_handler.c +3 -3
- data/ext/nokogiri/xml_entity_decl.c +6 -6
- data/ext/nokogiri/xml_entity_reference.c +1 -1
- data/ext/nokogiri/xml_namespace.c +80 -14
- data/ext/nokogiri/xml_node.c +363 -82
- data/ext/nokogiri/xml_node_set.c +4 -6
- data/ext/nokogiri/xml_processing_instruction.c +1 -1
- data/ext/nokogiri/xml_reader.c +97 -22
- data/ext/nokogiri/xml_relax_ng.c +1 -3
- data/ext/nokogiri/xml_sax_parser.c +23 -17
- data/ext/nokogiri/xml_sax_parser_context.c +1 -6
- data/ext/nokogiri/xml_sax_push_parser.c +1 -3
- data/ext/nokogiri/xml_schema.c +4 -6
- data/ext/nokogiri/xml_syntax_error.c +1 -1
- data/ext/nokogiri/xml_text.c +2 -2
- data/ext/nokogiri/xml_xpath_context.c +91 -84
- data/ext/nokogiri/xslt_stylesheet.c +15 -14
- data/gumbo-parser/Makefile +10 -0
- data/gumbo-parser/src/attribute.h +1 -1
- data/gumbo-parser/src/error.c +2 -2
- data/gumbo-parser/src/error.h +1 -1
- data/gumbo-parser/src/foreign_attrs.c +2 -2
- data/gumbo-parser/src/{gumbo.h → nokogiri_gumbo.h} +1 -0
- data/gumbo-parser/src/parser.c +8 -5
- data/gumbo-parser/src/replacement.h +1 -1
- data/gumbo-parser/src/string_buffer.h +1 -1
- data/gumbo-parser/src/string_piece.c +1 -1
- data/gumbo-parser/src/svg_attrs.c +2 -2
- data/gumbo-parser/src/svg_tags.c +2 -2
- data/gumbo-parser/src/tag.c +2 -1
- data/gumbo-parser/src/tag_lookup.c +7 -7
- data/gumbo-parser/src/tag_lookup.gperf +1 -0
- data/gumbo-parser/src/tag_lookup.h +1 -1
- data/gumbo-parser/src/token_buffer.h +1 -1
- data/gumbo-parser/src/tokenizer.c +1 -1
- data/gumbo-parser/src/tokenizer.h +1 -1
- data/gumbo-parser/src/utf8.c +1 -1
- data/gumbo-parser/src/utf8.h +1 -1
- data/gumbo-parser/src/util.c +1 -3
- data/gumbo-parser/src/util.h +4 -0
- data/gumbo-parser/src/vector.h +1 -1
- data/lib/nokogiri/css/node.rb +2 -2
- data/lib/nokogiri/css/xpath_visitor.rb +5 -3
- data/lib/nokogiri/css.rb +6 -0
- data/lib/nokogiri/decorators/slop.rb +1 -1
- data/lib/nokogiri/encoding_handler.rb +57 -0
- data/lib/nokogiri/extension.rb +3 -2
- data/lib/nokogiri/html4/document.rb +2 -121
- data/lib/nokogiri/html4/element_description_defaults.rb +6 -12
- data/lib/nokogiri/html4/encoding_reader.rb +121 -0
- data/lib/nokogiri/html4.rb +1 -0
- data/lib/nokogiri/html5/document.rb +113 -36
- data/lib/nokogiri/html5/document_fragment.rb +9 -2
- data/lib/nokogiri/html5/node.rb +3 -5
- data/lib/nokogiri/html5.rb +127 -216
- data/lib/nokogiri/jruby/dependencies.rb +1 -19
- data/lib/nokogiri/jruby/nokogiri_jars.rb +43 -0
- data/lib/nokogiri/version/constant.rb +1 -1
- data/lib/nokogiri/version/info.rb +11 -10
- data/lib/nokogiri/xml/attr.rb +49 -0
- data/lib/nokogiri/xml/builder.rb +1 -1
- data/lib/nokogiri/xml/document.rb +103 -55
- data/lib/nokogiri/xml/document_fragment.rb +49 -6
- data/lib/nokogiri/xml/namespace.rb +42 -0
- data/lib/nokogiri/xml/node/save_options.rb +6 -4
- data/lib/nokogiri/xml/node.rb +190 -35
- data/lib/nokogiri/xml/node_set.rb +88 -9
- data/lib/nokogiri/xml/parse_options.rb +129 -50
- data/lib/nokogiri/xml/pp/node.rb +6 -4
- data/lib/nokogiri/xml/processing_instruction.rb +2 -1
- data/lib/nokogiri/xml/reader.rb +6 -8
- data/lib/nokogiri/xml/sax/parser.rb +2 -3
- data/lib/nokogiri/xslt.rb +1 -1
- data/lib/nokogiri.rb +3 -11
- data/lib/xsd/xmlparser/nokogiri.rb +3 -1
- data/ports/archives/libxml2-2.10.3.tar.xz +0 -0
- data/ports/archives/libxslt-1.1.37.tar.xz +0 -0
- metadata +11 -242
- data/patches/libxml2/0004-use-glibc-strlen.patch +0 -53
- data/patches/libxml2/0005-avoid-isnan-isinf.patch +0 -81
- data/patches/libxml2/0006-update-automake-files-for-arm64.patch +0 -3040
- data/patches/libxml2/0008-htmlParseComment-handle-abruptly-closed-comments.patch +0 -61
- data/ports/archives/libxml2-2.9.14.tar.xz +0 -0
- data/ports/archives/libxslt-1.1.35.tar.xz +0 -0
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nokogiri
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.14.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Dalessio
|
@@ -20,7 +20,7 @@ authors:
|
|
20
20
|
autorequire:
|
21
21
|
bindir: bin
|
22
22
|
cert_chain: []
|
23
|
-
date:
|
23
|
+
date: 2023-02-13 00:00:00.000000000 Z
|
24
24
|
dependencies:
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: mini_portile2
|
@@ -50,240 +50,10 @@ dependencies:
|
|
50
50
|
- - "~>"
|
51
51
|
- !ruby/object:Gem::Version
|
52
52
|
version: '1.4'
|
53
|
-
- !ruby/object:Gem::Dependency
|
54
|
-
name: bundler
|
55
|
-
requirement: !ruby/object:Gem::Requirement
|
56
|
-
requirements:
|
57
|
-
- - "~>"
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
version: '2.2'
|
60
|
-
type: :development
|
61
|
-
prerelease: false
|
62
|
-
version_requirements: !ruby/object:Gem::Requirement
|
63
|
-
requirements:
|
64
|
-
- - "~>"
|
65
|
-
- !ruby/object:Gem::Version
|
66
|
-
version: '2.2'
|
67
|
-
- !ruby/object:Gem::Dependency
|
68
|
-
name: hoe-markdown
|
69
|
-
requirement: !ruby/object:Gem::Requirement
|
70
|
-
requirements:
|
71
|
-
- - "~>"
|
72
|
-
- !ruby/object:Gem::Version
|
73
|
-
version: '1.4'
|
74
|
-
type: :development
|
75
|
-
prerelease: false
|
76
|
-
version_requirements: !ruby/object:Gem::Requirement
|
77
|
-
requirements:
|
78
|
-
- - "~>"
|
79
|
-
- !ruby/object:Gem::Version
|
80
|
-
version: '1.4'
|
81
|
-
- !ruby/object:Gem::Dependency
|
82
|
-
name: minitest
|
83
|
-
requirement: !ruby/object:Gem::Requirement
|
84
|
-
requirements:
|
85
|
-
- - "~>"
|
86
|
-
- !ruby/object:Gem::Version
|
87
|
-
version: '5.15'
|
88
|
-
type: :development
|
89
|
-
prerelease: false
|
90
|
-
version_requirements: !ruby/object:Gem::Requirement
|
91
|
-
requirements:
|
92
|
-
- - "~>"
|
93
|
-
- !ruby/object:Gem::Version
|
94
|
-
version: '5.15'
|
95
|
-
- !ruby/object:Gem::Dependency
|
96
|
-
name: minitest-reporters
|
97
|
-
requirement: !ruby/object:Gem::Requirement
|
98
|
-
requirements:
|
99
|
-
- - "~>"
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
version: '1.4'
|
102
|
-
type: :development
|
103
|
-
prerelease: false
|
104
|
-
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
requirements:
|
106
|
-
- - "~>"
|
107
|
-
- !ruby/object:Gem::Version
|
108
|
-
version: '1.4'
|
109
|
-
- !ruby/object:Gem::Dependency
|
110
|
-
name: rake
|
111
|
-
requirement: !ruby/object:Gem::Requirement
|
112
|
-
requirements:
|
113
|
-
- - "~>"
|
114
|
-
- !ruby/object:Gem::Version
|
115
|
-
version: '13.0'
|
116
|
-
type: :development
|
117
|
-
prerelease: false
|
118
|
-
version_requirements: !ruby/object:Gem::Requirement
|
119
|
-
requirements:
|
120
|
-
- - "~>"
|
121
|
-
- !ruby/object:Gem::Version
|
122
|
-
version: '13.0'
|
123
|
-
- !ruby/object:Gem::Dependency
|
124
|
-
name: rake-compiler
|
125
|
-
requirement: !ruby/object:Gem::Requirement
|
126
|
-
requirements:
|
127
|
-
- - '='
|
128
|
-
- !ruby/object:Gem::Version
|
129
|
-
version: 1.1.7
|
130
|
-
type: :development
|
131
|
-
prerelease: false
|
132
|
-
version_requirements: !ruby/object:Gem::Requirement
|
133
|
-
requirements:
|
134
|
-
- - '='
|
135
|
-
- !ruby/object:Gem::Version
|
136
|
-
version: 1.1.7
|
137
|
-
- !ruby/object:Gem::Dependency
|
138
|
-
name: rake-compiler-dock
|
139
|
-
requirement: !ruby/object:Gem::Requirement
|
140
|
-
requirements:
|
141
|
-
- - "~>"
|
142
|
-
- !ruby/object:Gem::Version
|
143
|
-
version: '1.2'
|
144
|
-
type: :development
|
145
|
-
prerelease: false
|
146
|
-
version_requirements: !ruby/object:Gem::Requirement
|
147
|
-
requirements:
|
148
|
-
- - "~>"
|
149
|
-
- !ruby/object:Gem::Version
|
150
|
-
version: '1.2'
|
151
|
-
- !ruby/object:Gem::Dependency
|
152
|
-
name: rdoc
|
153
|
-
requirement: !ruby/object:Gem::Requirement
|
154
|
-
requirements:
|
155
|
-
- - "~>"
|
156
|
-
- !ruby/object:Gem::Version
|
157
|
-
version: '6.3'
|
158
|
-
type: :development
|
159
|
-
prerelease: false
|
160
|
-
version_requirements: !ruby/object:Gem::Requirement
|
161
|
-
requirements:
|
162
|
-
- - "~>"
|
163
|
-
- !ruby/object:Gem::Version
|
164
|
-
version: '6.3'
|
165
|
-
- !ruby/object:Gem::Dependency
|
166
|
-
name: rexical
|
167
|
-
requirement: !ruby/object:Gem::Requirement
|
168
|
-
requirements:
|
169
|
-
- - "~>"
|
170
|
-
- !ruby/object:Gem::Version
|
171
|
-
version: 1.0.7
|
172
|
-
type: :development
|
173
|
-
prerelease: false
|
174
|
-
version_requirements: !ruby/object:Gem::Requirement
|
175
|
-
requirements:
|
176
|
-
- - "~>"
|
177
|
-
- !ruby/object:Gem::Version
|
178
|
-
version: 1.0.7
|
179
|
-
- !ruby/object:Gem::Dependency
|
180
|
-
name: rubocop
|
181
|
-
requirement: !ruby/object:Gem::Requirement
|
182
|
-
requirements:
|
183
|
-
- - "~>"
|
184
|
-
- !ruby/object:Gem::Version
|
185
|
-
version: '1.28'
|
186
|
-
- - ">="
|
187
|
-
- !ruby/object:Gem::Version
|
188
|
-
version: 1.28.2
|
189
|
-
type: :development
|
190
|
-
prerelease: false
|
191
|
-
version_requirements: !ruby/object:Gem::Requirement
|
192
|
-
requirements:
|
193
|
-
- - "~>"
|
194
|
-
- !ruby/object:Gem::Version
|
195
|
-
version: '1.28'
|
196
|
-
- - ">="
|
197
|
-
- !ruby/object:Gem::Version
|
198
|
-
version: 1.28.2
|
199
|
-
- !ruby/object:Gem::Dependency
|
200
|
-
name: rubocop-minitest
|
201
|
-
requirement: !ruby/object:Gem::Requirement
|
202
|
-
requirements:
|
203
|
-
- - "~>"
|
204
|
-
- !ruby/object:Gem::Version
|
205
|
-
version: '0.17'
|
206
|
-
type: :development
|
207
|
-
prerelease: false
|
208
|
-
version_requirements: !ruby/object:Gem::Requirement
|
209
|
-
requirements:
|
210
|
-
- - "~>"
|
211
|
-
- !ruby/object:Gem::Version
|
212
|
-
version: '0.17'
|
213
|
-
- !ruby/object:Gem::Dependency
|
214
|
-
name: rubocop-performance
|
215
|
-
requirement: !ruby/object:Gem::Requirement
|
216
|
-
requirements:
|
217
|
-
- - "~>"
|
218
|
-
- !ruby/object:Gem::Version
|
219
|
-
version: '1.12'
|
220
|
-
type: :development
|
221
|
-
prerelease: false
|
222
|
-
version_requirements: !ruby/object:Gem::Requirement
|
223
|
-
requirements:
|
224
|
-
- - "~>"
|
225
|
-
- !ruby/object:Gem::Version
|
226
|
-
version: '1.12'
|
227
|
-
- !ruby/object:Gem::Dependency
|
228
|
-
name: rubocop-rake
|
229
|
-
requirement: !ruby/object:Gem::Requirement
|
230
|
-
requirements:
|
231
|
-
- - "~>"
|
232
|
-
- !ruby/object:Gem::Version
|
233
|
-
version: '0.6'
|
234
|
-
type: :development
|
235
|
-
prerelease: false
|
236
|
-
version_requirements: !ruby/object:Gem::Requirement
|
237
|
-
requirements:
|
238
|
-
- - "~>"
|
239
|
-
- !ruby/object:Gem::Version
|
240
|
-
version: '0.6'
|
241
|
-
- !ruby/object:Gem::Dependency
|
242
|
-
name: rubocop-shopify
|
243
|
-
requirement: !ruby/object:Gem::Requirement
|
244
|
-
requirements:
|
245
|
-
- - "~>"
|
246
|
-
- !ruby/object:Gem::Version
|
247
|
-
version: '2.3'
|
248
|
-
type: :development
|
249
|
-
prerelease: false
|
250
|
-
version_requirements: !ruby/object:Gem::Requirement
|
251
|
-
requirements:
|
252
|
-
- - "~>"
|
253
|
-
- !ruby/object:Gem::Version
|
254
|
-
version: '2.3'
|
255
|
-
- !ruby/object:Gem::Dependency
|
256
|
-
name: ruby_memcheck
|
257
|
-
requirement: !ruby/object:Gem::Requirement
|
258
|
-
requirements:
|
259
|
-
- - "~>"
|
260
|
-
- !ruby/object:Gem::Version
|
261
|
-
version: '1.0'
|
262
|
-
type: :development
|
263
|
-
prerelease: false
|
264
|
-
version_requirements: !ruby/object:Gem::Requirement
|
265
|
-
requirements:
|
266
|
-
- - "~>"
|
267
|
-
- !ruby/object:Gem::Version
|
268
|
-
version: '1.0'
|
269
|
-
- !ruby/object:Gem::Dependency
|
270
|
-
name: simplecov
|
271
|
-
requirement: !ruby/object:Gem::Requirement
|
272
|
-
requirements:
|
273
|
-
- - "~>"
|
274
|
-
- !ruby/object:Gem::Version
|
275
|
-
version: '0.21'
|
276
|
-
type: :development
|
277
|
-
prerelease: false
|
278
|
-
version_requirements: !ruby/object:Gem::Requirement
|
279
|
-
requirements:
|
280
|
-
- - "~>"
|
281
|
-
- !ruby/object:Gem::Version
|
282
|
-
version: '0.21'
|
283
53
|
description: |
|
284
54
|
Nokogiri (鋸) makes it easy and painless to work with XML and HTML from Ruby. It provides a
|
285
55
|
sensible, easy-to-understand API for reading, writing, modifying, and querying documents. It is
|
286
|
-
fast and standards-compliant by relying on native parsers like libxml2
|
56
|
+
fast and standards-compliant by relying on native parsers like libxml2, libgumbo, or xerces.
|
287
57
|
email: nokogiri-talk@googlegroups.com
|
288
58
|
executables:
|
289
59
|
- nokogiri
|
@@ -387,9 +157,9 @@ files:
|
|
387
157
|
- gumbo-parser/src/error.h
|
388
158
|
- gumbo-parser/src/foreign_attrs.c
|
389
159
|
- gumbo-parser/src/foreign_attrs.gperf
|
390
|
-
- gumbo-parser/src/gumbo.h
|
391
160
|
- gumbo-parser/src/insertion_mode.h
|
392
161
|
- gumbo-parser/src/macros.h
|
162
|
+
- gumbo-parser/src/nokogiri_gumbo.h
|
393
163
|
- gumbo-parser/src/parser.c
|
394
164
|
- gumbo-parser/src/parser.h
|
395
165
|
- gumbo-parser/src/replacement.h
|
@@ -428,6 +198,7 @@ files:
|
|
428
198
|
- lib/nokogiri/css/tokenizer.rex
|
429
199
|
- lib/nokogiri/css/xpath_visitor.rb
|
430
200
|
- lib/nokogiri/decorators/slop.rb
|
201
|
+
- lib/nokogiri/encoding_handler.rb
|
431
202
|
- lib/nokogiri/extension.rb
|
432
203
|
- lib/nokogiri/gumbo.rb
|
433
204
|
- lib/nokogiri/html.rb
|
@@ -437,6 +208,7 @@ files:
|
|
437
208
|
- lib/nokogiri/html4/document_fragment.rb
|
438
209
|
- lib/nokogiri/html4/element_description.rb
|
439
210
|
- lib/nokogiri/html4/element_description_defaults.rb
|
211
|
+
- lib/nokogiri/html4/encoding_reader.rb
|
440
212
|
- lib/nokogiri/html4/entity_lookup.rb
|
441
213
|
- lib/nokogiri/html4/sax/parser.rb
|
442
214
|
- lib/nokogiri/html4/sax/parser_context.rb
|
@@ -446,6 +218,7 @@ files:
|
|
446
218
|
- lib/nokogiri/html5/document_fragment.rb
|
447
219
|
- lib/nokogiri/html5/node.rb
|
448
220
|
- lib/nokogiri/jruby/dependencies.rb
|
221
|
+
- lib/nokogiri/jruby/nokogiri_jars.rb
|
449
222
|
- lib/nokogiri/syntax_error.rb
|
450
223
|
- lib/nokogiri/version.rb
|
451
224
|
- lib/nokogiri/version/constant.rb
|
@@ -493,14 +266,10 @@ files:
|
|
493
266
|
- patches/libxml2/0001-Remove-script-macro-support.patch
|
494
267
|
- patches/libxml2/0002-Update-entities-to-remove-handling-of-ssi.patch
|
495
268
|
- patches/libxml2/0003-libxml2.la-is-in-top_builddir.patch
|
496
|
-
- patches/libxml2/0004-use-glibc-strlen.patch
|
497
|
-
- patches/libxml2/0005-avoid-isnan-isinf.patch
|
498
|
-
- patches/libxml2/0006-update-automake-files-for-arm64.patch
|
499
|
-
- patches/libxml2/0008-htmlParseComment-handle-abruptly-closed-comments.patch
|
500
269
|
- patches/libxml2/0009-allow-wildcard-namespaces.patch
|
501
270
|
- patches/libxslt/0001-update-automake-files-for-arm64.patch
|
502
|
-
- ports/archives/libxml2-2.
|
503
|
-
- ports/archives/libxslt-1.1.
|
271
|
+
- ports/archives/libxml2-2.10.3.tar.xz
|
272
|
+
- ports/archives/libxslt-1.1.37.tar.xz
|
504
273
|
homepage: https://nokogiri.org
|
505
274
|
licenses:
|
506
275
|
- MIT
|
@@ -521,14 +290,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
521
290
|
requirements:
|
522
291
|
- - ">="
|
523
292
|
- !ruby/object:Gem::Version
|
524
|
-
version: 2.
|
293
|
+
version: 2.7.0
|
525
294
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
526
295
|
requirements:
|
527
296
|
- - ">="
|
528
297
|
- !ruby/object:Gem::Version
|
529
298
|
version: '0'
|
530
299
|
requirements: []
|
531
|
-
rubygems_version: 3.
|
300
|
+
rubygems_version: 3.4.1
|
532
301
|
signing_key:
|
533
302
|
specification_version: 4
|
534
303
|
summary: Nokogiri (鋸) makes it easy and painless to work with XML and HTML from Ruby.
|
@@ -1,53 +0,0 @@
|
|
1
|
-
From c94172d2a4451368530db2186190d70be8a1d9e5 Mon Sep 17 00:00:00 2001
|
2
|
-
From: Ilya Zub <ilya@serpapi.com>
|
3
|
-
Date: Wed, 23 Dec 2020 12:45:29 +0200
|
4
|
-
Subject: Use glibc strlen to speed up xmlStrlen
|
5
|
-
MIME-Version: 1.0
|
6
|
-
Content-Type: text/plain; charset=UTF-8
|
7
|
-
Content-Transfer-Encoding: 8bit
|
8
|
-
|
9
|
-
xmlStrlen (entire HTML file): 926171.936981 μs
|
10
|
-
glibc_xmlStrlen (entire HTML file): 36905.903992 μs
|
11
|
-
delta (xmlStrlen ÷ glibc_xmlStrlen): 25.094584 times
|
12
|
-
|
13
|
-
xmlStrlen (average string): 57479.204010 μs
|
14
|
-
glibc_xmlStrlen (average string): 5802.069000 μs
|
15
|
-
delta (xmlStrlen ÷ glibc_xmlStrlen): 9.905937 times
|
16
|
-
|
17
|
-
xmlStrlen (bigger string): 388056.315979 μs
|
18
|
-
glibc_xmlStrlen (bigger string): 12797.856995 μs
|
19
|
-
delta (xmlStrlen ÷ glibc_xmlStrlen): 30.318382 times
|
20
|
-
|
21
|
-
xmlStrlen (smallest string): 15870.046021 μs
|
22
|
-
glibc_xmlStrlen (smallest string): 6282.208984 μs
|
23
|
-
delta (xmlStrlen ÷ glibc_xmlStrlen): 2.527903 times
|
24
|
-
|
25
|
-
See https://gitlab.gnome.org/GNOME/libxml2/-/issues/212 for reference.
|
26
|
-
---
|
27
|
-
xmlstring.c | 9 ++-------
|
28
|
-
1 file changed, 2 insertions(+), 7 deletions(-)
|
29
|
-
|
30
|
-
diff --git a/xmlstring.c b/xmlstring.c
|
31
|
-
index e8a1e45d..df247dff 100644
|
32
|
-
--- a/xmlstring.c
|
33
|
-
+++ b/xmlstring.c
|
34
|
-
@@ -423,12 +423,7 @@ xmlStrsub(const xmlChar *str, int start, int len) {
|
35
|
-
|
36
|
-
int
|
37
|
-
xmlStrlen(const xmlChar *str) {
|
38
|
-
- size_t len = 0;
|
39
|
-
-
|
40
|
-
if (str == NULL) return(0);
|
41
|
-
- while (*str != 0) { /* non input consuming */
|
42
|
-
- str++;
|
43
|
-
- len++;
|
44
|
-
- }
|
45
|
-
- return(len > INT_MAX ? 0 : len);
|
46
|
-
+
|
47
|
-
+ return strlen((const char*)str);
|
48
|
-
}
|
49
|
-
|
50
|
-
/**
|
51
|
-
--
|
52
|
-
2.29.2
|
53
|
-
|
@@ -1,81 +0,0 @@
|
|
1
|
-
This patch is a result of rake-compiler-dock using centos 7 (manylinux2014) to cross-compile.
|
2
|
-
|
3
|
-
Centos, for reasons I have not been able to discern, implements `isnan` and `isinf` as a function
|
4
|
-
and not as a macro. Debian knows how to resolve that function at dynamic-link time (despite using a
|
5
|
-
macro at compile time), but musl-based systems (like alpine) do not. Running `nm` on nokogiri.so
|
6
|
-
created on such a centos system shows:
|
7
|
-
|
8
|
-
```
|
9
|
-
U __isinf@@GLIBC_2.2.5
|
10
|
-
U __isnan@@GLIBC_2.2.5
|
11
|
-
```
|
12
|
-
|
13
|
-
(see https://github.com/sparklemotion/nokogiri/pull/2142 for more info)
|
14
|
-
|
15
|
-
This patch avoids using glibc's `isnan` and `isinf` calls, instead using libxml2's fallback
|
16
|
-
implementation. There's history here, see libxml2 commit 8813f39:
|
17
|
-
|
18
|
-
commit 8813f39
|
19
|
-
Author: Nick Wellnhofer <wellnhofer@aevum.de>
|
20
|
-
Date: 2017-09-21 00:11:26 +0200
|
21
|
-
|
22
|
-
Simplify XPath NaN, inf and -0 handling
|
23
|
-
|
24
|
-
Use C99 macros NAN, INFINITY, isnan, isinf. If they're not available:
|
25
|
-
|
26
|
-
- Assume that (0.0 / 0.0) generates a NaN and !(x == x) tests for NaN.
|
27
|
-
- Use C89's HUGE_VAL for INFINITY.
|
28
|
-
|
29
|
-
Remove manual handling of NaN, infinity and negative zero in functions
|
30
|
-
xmlXPathValueFlipSign and xmlXPathDivValues.
|
31
|
-
|
32
|
-
Remove xmlXPathGetSign. All the tests for negative zero can be replaced
|
33
|
-
with a test for negative or positive zero.
|
34
|
-
|
35
|
-
Simplify xmlXPathRoundFunction.
|
36
|
-
|
37
|
-
Remove Trio dependency.
|
38
|
-
|
39
|
-
This should work on IEEE 754 compliant implementations even if the C99
|
40
|
-
macros aren't available, but will likely break some ancient platforms.
|
41
|
-
If problems arise, my plan is to port the relevant trionan.c solution
|
42
|
-
to xpath.c. Note that non-compliant implementations are impossible
|
43
|
-
to fully support, anyway, since XPath requires IEEE 754.
|
44
|
-
|
45
|
-
This patch would be unnecessary if any of the following was true:
|
46
|
-
|
47
|
-
* centos implements these as macros, and doesn't generate an unresolved symbol for either in the shared library
|
48
|
-
* we had a way to ensure `__isinf` and `__isnan` resolve on musl (e.g., we implement them locally)
|
49
|
-
|
50
|
-
diff --git a/xpath.c b/xpath.c
|
51
|
-
index 9f64ab9..5b6d999 100644
|
52
|
-
--- a/xpath.c
|
53
|
-
+++ b/xpath.c
|
54
|
-
@@ -515,11 +515,7 @@ xmlXPathInit(void) {
|
55
|
-
*/
|
56
|
-
int
|
57
|
-
xmlXPathIsNaN(double val) {
|
58
|
-
-#ifdef isnan
|
59
|
-
- return isnan(val);
|
60
|
-
-#else
|
61
|
-
return !(val == val);
|
62
|
-
-#endif
|
63
|
-
}
|
64
|
-
|
65
|
-
/**
|
66
|
-
@@ -530,15 +530,11 @@ xmlXPathIsNaN(double val) {
|
67
|
-
*/
|
68
|
-
int
|
69
|
-
xmlXPathIsInf(double val) {
|
70
|
-
-#ifdef isinf
|
71
|
-
- return isinf(val) ? (val > 0 ? 1 : -1) : 0;
|
72
|
-
-#else
|
73
|
-
if (val >= xmlXPathPINF)
|
74
|
-
return 1;
|
75
|
-
if (val <= -xmlXPathPINF)
|
76
|
-
return -1;
|
77
|
-
return 0;
|
78
|
-
-#endif
|
79
|
-
}
|
80
|
-
|
81
|
-
#endif /* SCHEMAS or XPATH */
|