This project is archived and is in readonly mode.
[PATCH] SAX-based backend for XmlMini, using Nokogiri and/or LibXML
-
Bart ten Brinke
Wow, a factor 10 speed increase is really insane.
Patch applies and suite runs perfectly.
+1 -
Bart ten Brinke
- Assigned user set to Jeremy Kemper
-
Aaron Patterson
Plus one
-
Mike Dalessio
A definite +1, code is clean and tests are thorough.
-
Willem van Bergen
I have also rewrote the current LibXML and Nokogiri backends to fix bugs and improve speeds, for both Rails 3 and Rails 2.3. See the ticket for patches at https://rails.lighthouseapp.com/projects/8994/tickets/3641
The new tests I wrote for that ticket, show that this SAX-based backend still has issues (just like the default Nokogiri backend and LibXML backend) and is not compatible with Rails 3. I will upload a new SAX-based patch here soon that resolves these issues.
-
Willem van Bergen
I attached a file which implements two SAX-based parsers for XmlMini, using both Nokogiri and LibXML. Currently, this patch is only for the master branch. I will attach a backported version later today for Rails 2.3.
Performance comparison
The following results are for the Rails 3 branch. The REXML, LibXML and Nokogiri results are the unchanged version. The LibXML++ and Nokogiri++ versions are the patched version from my other ticket (https://rails.lighthouseapp.com/projects/8994/tickets/3641).
user system total real REXML 17.170000 0.060000 17.230000 ( 17.297263) LibXML 2.100000 0.100000 2.200000 ( 2.217380) LibXML++ 0.530000 0.000000 0.530000 ( 0.531034) LibXMLSAX 0.630000 0.010000 0.640000 ( 0.632472) Nokogiri 5.280000 0.020000 5.300000 ( 5.322575) Nokogiri++ 1.840000 0.020000 1.860000 ( 1.872055) NokogiriSAX 0.770000 0.000000 0.770000 ( 0.778777)As it seems, the improved LibXML++ implementation is the fastest, but if you want to stick to Nokogiri, the SAX-based parser comes close.
-
Willem van Bergen
And a backported version for Rails 2.3.
-
Willem van Bergen
- Tag changed from activesupport, backend, nokogiri, patch, sax, xmlmini to activesupport, backend, libxml, nokogiri, patch, sax, xmlmini
- Title changed from SAX/Nokogiri backend for XmlMini to [PATCH] SAX-based backend for XmlMini, using Nokogiri and/or LibXML
-
Repository
(from [37c51594b9610469173f3deee1ffdda4beb3e397]) Added two SAX-based backends for XmlMini, using both LibXML and Nokogiri.
[#3636]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
http://github.com/rails/rails/commit/37c51594b9610469173f3deee1ffdd... -
Repository
- State changed from new to committed
(from [689984ddd3a482b5c0986fdf1889323f096050fa]) Fixed some bugs and fixed some tests in new SAX-based XmlMini backends.
[#3636 state:committed]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
http://github.com/rails/rails/commit/689984ddd3a482b5c0986fdf188932...
