This project is archived and is in readonly mode.
DateTime#to_json is slow.
-
Alex Zepeda
- Title changed from Time#to_json to Time#to_json is slow.
-
Cheah Chu Yeow
This looks good but it's slightly outdated because it's diffed against the old SVN version of Rails). Don't think Jeremy will have a problem with that though :)
-
Ripta Pasay
- Title changed from Time#to_json is slow. to DateTime#to_json is slow.
- Tag changed from 2.0-stable, activerecord, patch to 2.0-stable, activesupport, patch
Benchmarking the changes, I could only get about a 0.25% speed-up at best. I agree the string operation is unnecessary and there was a speed-up, but it seems negligible over a large number of iterations.
n = 100,000 user system total real original 62.240000 0.090000 62.330000 ( 62.431844) patched 62.090000 0.090000 62.180000 ( 62.276596)Benchmark attached, in case I missed something.
-
Repository
(from [9783e66cade4d145389cca18fab822f44d03161a]) Slightly faster DateTime#to_json. [#598 state:resolved] [Alex Zepeda]
-
Pratik
- State changed from new to resolved
-
Repository
(from [50c73c2dfd0d5eb880426e7bc385bcee004ffe3e]) Slightly faster DateTime#to_json. [#598 DateTime#to_json is slow. state:resolved] [Alex Zepeda] http://github.com/rails/rails/co...
