Skip to content

rti/FastXml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

================================================================================
FastXml
================================================================================

Faster XML generation for Ruby on Rails.

Calling #to_xml on large data sets can use quite a lot of cpu time.
This plugin is meant to speed up the generation to XML documents that are based 
on active record data.

Technically, this plugin re-implements Array#to_xml and 
ActiveRecord::Base#to_xml. To speed up the creation of XML output, this plugin
uses the gem 'libxml-ruby' which provides a native binding to libxml.


================================================================================
How to use
================================================================================

To use this plugin, go to your rails application root and do:
$ ./script/plugin install [email protected]:rti/FastXml.git

If you do not have the 'libxml-ruby' gem installed, you need to
$ gem install libxml-ruby

If you now start your rails application with
$ ./script/server

You should see some output like "FastXml 0.2.1 loaded". Thats all. Array#to_xml
and ActiveRecord::Base#to_xml are replaced and ready to use. So for example 
every .xml generated by scaffolding will run way faster now. 

If you are still not satisfied with the speed up, you can call #to_xml with the
strip option: 
# User.find(:all).to_xml(:strip => true)

This will reduce the complexity of the XML by not generating type or nil 
attributes. Indention will be disabled too.

Depending on your environment, you can expect your XML generation to run around 
4 times faster.

This plugin was developed for and tested with Ruby 1.8.7, Rails 2.3.5.

================================================================================
Who made it
================================================================================

This plugin was developed at A.R.T.E.C.O. GmbH in Berlin for 
https://xml.arteco.de, a fleet management web service. 

To find out more, check out https://peilsender.de.


Copyright (c) 2010 peilsender.de / rtti.de, released under the MIT license

About

Faster XML generation for Ruby on Rails.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages