Hi, I''m trying to find the fastest XML parser for FreeBSD 6.2. I tried to install the gem for libxml, but it doesn''t install on FreeBSD 6.2. I also tried the FreeBSD port for libxml-ruby, but it appears to be very buggy. I''m taking several xml feeds, 100k or less, parsing them, and putting them into a database. rexml is slow. The word on the net is to use a C parser -- is there a good one I can use, with understandable documentation for a newbie? Thanks, Charlie --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi, please define what you mean by slow. What times are you seeing during the parsing of the XML? -Conrad On 8/14/07, charlie caroff <charlie.caroff-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Hi, > > I''m trying to find the fastest XML parser for FreeBSD 6.2. I tried to > install the gem for libxml, but it doesn''t install on FreeBSD 6.2. I > also tried the FreeBSD port for libxml-ruby, but it appears to be very > buggy. > > I''m taking several xml feeds, 100k or less, parsing them, and putting > them into a database. rexml is slow. The word on the net is to use a > C parser -- is there a good one I can use, with understandable > documentation for a newbie? > > Thanks, > > Charlie > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
charlie caroff wrote:> Hi, > > I''m trying to find the fastest XML parser for FreeBSD 6.2. I tried to > install the gem for libxml, but it doesn''t install on FreeBSD 6.2. I > also tried the FreeBSD port for libxml-ruby, but it appears to be very > buggy. > > I''m taking several xml feeds, 100k or less, parsing them, and putting > them into a database. rexml is slow. The word on the net is to use a > C parser -- is there a good one I can use, with understandable > documentation for a newbie?You could try Hpricot. -- Michael Wang --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hpricot is extremely slow on large documents (> 50 MB) but should work fast on the size you are looking at. libxml would still be the fastest option if you get it working (I had to strip all tags from the root node to get it working for me, but I am dealing with 5-10 GB files so I had no other choice but to go with libxml-ruby). Craig On Aug 15, 6:34 am, Michael Wang <rails-u...-JtyympAsP2K7zZZRDBGcUA@public.gmane.org> wrote:> charlie caroff wrote: > > Hi, > > > I''m trying to find the fastest XML parser for FreeBSD 6.2. I tried to > > install the gem for libxml, but it doesn''t install on FreeBSD 6.2. I > > also tried the FreeBSD port for libxml-ruby, but it appears to be very > > buggy. > > > I''m taking several xml feeds, 100k or less, parsing them, and putting > > them into a database. rexml is slow. The word on the net is to use a > > C parser -- is there a good one I can use, with understandable > > documentation for a newbie? > > You could try Hpricot. > > -- > Michael Wang--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Conrad Taylor wrote:> Hi, please define what you mean by slow. What times are you seeing > during the parsing of the XML? > > -Conrad > > On 8/14/07, *charlie caroff* < charlie.caroff-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > <mailto:charlie.caroff-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> wrote: > > > Hi, > > I''m trying to find the fastest XML parser for FreeBSD 6.2. I tried to > install the gem for libxml, but it doesn''t install on FreeBSD 6.2. I > also tried the FreeBSD port for libxml-ruby, but it appears to be very > buggy. > > I''m taking several xml feeds, 100k or less, parsing them, and putting > them into a database. rexml is slow. The word on the net is to use a > C parser -- is there a good one I can use, with understandable > documentation for a newbie? > > Thanks, > > Charlie >I use the expat library - one of the samples that comes with the code is simple enough to extend if you know C. My suggestion would be to parse off the XML quickly and convert it into another format that can then be used by your Ruby code. It would be good if you could explain how often you need to do this and if it''s only in the backend or in response to a user-loaded XML file. Cheers, Mohit. 8/15/2007 | 11:39 PM. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---