This project is archived and is in readonly mode.

#598 ✓resolved
Alex Zepeda

DateTime#to_json is slow.

Reported by Alex Zepeda | July 10th, 2008 @ 07:34 PM | in 2.x

The DateTime#to_json method is extremely slow. Converting ~6700 AR objects (with two datetime fields each) to JSON takes roughly 18 seconds on a 2.2GHz Core 2 Duo machine.

This patch simplifies the code, avoiding excessive string operations. End result is about a 5x improvement (~18 to ~2 seconds).

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Referenced by

Pages