Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

Consider switching to Oga #2

Open
colindean opened this issue Sep 13, 2014 · 6 comments
Open

Consider switching to Oga #2

colindean opened this issue Sep 13, 2014 · 6 comments

Comments

@colindean
Copy link
Member

Oga is a new XML parsing library that doesn't have massive dependencies like Nokogiri does. Use it instead.

@colindean colindean self-assigned this Sep 13, 2014
@colindean
Copy link
Member Author

@colindean
Copy link
Member Author

It was really quick to migrate to Oga. Change the instantiation, change the parse method, change how elements are identified, and change how attributes are accessed.

However, it seems to be a lot slower. Running some benchmarking now.

@colindean
Copy link
Member Author

[colin@kid ~]$ time gpsxml2csv ~/Downloads/Kismet-20140913-17-22-12-1.gpsxml > ~/Downloads/south-side_20140913.csv-nokogiri

real    0m7.440s
user    0m7.251s
sys 0m0.134s

@colindean
Copy link
Member Author

That, and this, are on MRI 2.1.2.

[colin@kid kismet-gpsxml (oga)]$ time gpsxml2csv ~/Downloads/Kismet-20140913-17-22-12-1.gpsxml > ~/Downloads/south-side_20140913.csv-oga

real    0m58.963s
user    0m56.495s
sys     0m1.317s

@colindean
Copy link
Member Author

Oga doesn't install on JRuby 1.7.15.

[colin@kid kismet-gpsxml (oga)]$ gem install oga
Building native extensions.  This could take a while...
ERROR:  Error installing oga:
        ERROR: Failed to build gem native extension.

    /Users/colin/.rvm/rubies/jruby-1.7.15/bin/jruby extconf.rb
NotImplementedError: C extension support is not enabled. Pass -Xcext.enabled=true to JRuby or set JRUBY_OPTS.

   (root) at /Users/colin/.rvm/rubies/jruby-1.7.15/lib/ruby/shared/mkmf.rb:8
  require at org/jruby/RubyKernel.java:1065
   (root) at /Users/colin/.rvm/rubies/jruby-1.7.15/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1
   (root) at extconf.rb:1


Gem files will remain installed in /Users/colin/.rvm/gems/jruby-1.7.15@gpsxml/gems/oga-0.1.1 for inspection.
Results logged to /Users/colin/.rvm/gems/jruby-1.7.15@gpsxml/gems/oga-0.1.1/ext/c/gem_make.out

@colindean colindean changed the title Switch to Oga Consider switching to Oga Sep 14, 2014
colindean added a commit that referenced this issue Sep 14, 2014
@colindean
Copy link
Member Author

Nokogiri version on JRuby took almost a minute, too, and ran out of RAM.

@colindean colindean removed their assignment Aug 1, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant