title: Use SerializeJSON to return an array of structs instead of JSON object with COLUMNS and DATA nodes?
body: <p>I am building a Railo app which deals with a lot of JSON data sent back and forth via Ajax. I've identified an opportunity to optimize its performance, but I'd like to hear some advice from the community before I tackle it.</p>
  
  <p>Here is a good example of the situation.</p>
  
  <p>I have an action on the server that queries a set of bid responses, serializes them to JSON, then returns them to my javascript on the front end, which then parses and renders some HTML. The format in which Railo returns the JSON is the familiar two-node object:</p>
  
  <pre><code>{"COLUMNS":["one","two","three",...],"DATA":["value","value","value",...]}
  </code></pre>
  
  <p>I wrote a function that utilizes <a href="http://documentcloud.github.com/underscore/" rel="nofollow noreferrer">underscore</a>'s map() function to convert this format into an array of objects with named nodes:</p>
  
  <pre><code>function toArgsObject(data,columns) {
  return _.map(data, function(w){
      var q = {};
      for (var i=0; i &lt; w.length; i++) { eval("q."+columns[i]+" = w[i]"); };
      return q;
  });
  };
  </code></pre>
  
  <p>This gets the job done nicely, <strong>however the performance isn't very good!</strong> Even with swift js interpreters like those in webkit and firefox, this function often accounts for 75% of processing time in the functions that call it, especially when the data sets are large. I'd like to see how much improvement I would get by offloading this processing to the server, but I don't quite have the cfml / cfscript chops to write an efficient version of this.</p>
  
  <p>What I need to come back from the server, then, would look like this:</p>
  
  <pre><code>[
  {"one":"value","two":"value","three":"value"},
  {"one":"value","two":"value","three":"value"}.
  ...
  ]
  </code></pre>
  
  <p>I understand that the format used by SerializeJSON creates responses that are far smaller and therefore use less bandwidth to send. This is where the experimentation comes in. I'd like to see how it impacts my application to do things differently!</p>
  
  <p><strong>has anyone written a JSON Serializer that can return data in this format?</strong></p>