JSON: speed up date/time encoding
JSON: speed up date/time encoding

Comparing dates & times with other objects using #== is slow.
Internally, it hits #<=> which calls #to_datetime on objects
that don't respond to it, so we incur the cost of raising an
exception with a possibly-deep backtrace.

Cost of #jsonify on a Time object:

Calculating -------------------------------------
                 old      3644 i/100ms
                 new     12652 i/100ms
-------------------------------------------------
                 old    43373.8 (±3.5%) i/s -     218640 in   5.047017s
                 new   173437.6 (±5.2%) i/s -     872988 in   5.047747s

untidy-hair/rails,kmcphillips/rails,sealocal/rails,kmcphillips/rails,lucasmazza/rails,schuetzm/rails,notapatch/rails,yhirano55/rails,koic/rails,rossta/rails,arjes/rails,utilum/rails,tijwelch/rails,mijoharas/rails,xlymian/rails,vassilevsky/rails,shioyama/rails,fabianoleittes/rails,shioyama/rails,coreyward/rails,baerjam/rails,aditya-kapoor/rails,mathieujobin/reduced-rails-for-travis,illacceptanything/illacceptanything,rbhitchcock/rails,georgeclaghorn/rails,jeremy/rails,yasslab/railsguides.jp,yawboakye/rails,lcreid/rails,yhirano55/rails,gcourtemanche/rails,illacceptanything/illacceptanything,prathamesh-sonpatki/rails,voray/rails,untidy-hair/rails,gauravtiwari/rails,Envek/rails,mathieujobin/reduced-rails-for-travis,yasslab/railsguides.jp,lcreid/rails,kamipo/rails,iainbeeston/rails,tijwelch/rails,mijoharas/rails,ngpestelos/rails,tijwelch/rails,hanystudy/rails,schuetzm/rails,georgeclaghorn/rails,Erol/rails,illacceptanything/illacceptanything,starknx/rails,palkan/rails,stefanmb/rails,marklocklear/rails,utilum/rails,pschambacher/rails,yalab/rails,88rabbit/newRails,assain/rails,illacceptanything/illacceptanything,kirs/rails-1,mohitnatoo/rails,riseshia/railsguides.kr,gcourtemanche/rails,arunagw/rails,alecspopa/rails,bradleypriest/rails,Vasfed/rails,amoody2108/TechForJustice,amoody2108/TechForJustice,MichaelSp/rails,travisofthenorth/rails,flanger001/rails,kenta-s/rails,brchristian/rails,arunagw/rails,mtsmfm/railstest,flanger001/rails,flanger001/rails,deraru/rails,vipulnsward/rails,Edouard-chin/rails,mohitnatoo/rails,Envek/rails,sealocal/rails,mtsmfm/rails,bolek/rails,gfvcastro/rails,schuetzm/rails,EmmaB/rails-1,gavingmiller/rails,stefanmb/rails,repinel/rails,kirs/rails-1,kachick/rails,Sen-Zhang/rails,baerjam/rails,rossta/rails,arunagw/rails,printercu/rails,travisofthenorth/rails,yahonda/rails,tjschuck/rails,illacceptanything/illacceptanything,MSP-Greg/rails,gfvcastro/rails,arjes/rails,iainbeeston/rails,kmcphillips/rails,joonyou/rails,maicher/rails,ledestin/rails,EmmaB/rails-1,Envek/rails,coreyward/rails,koic/rails,sergey-alekseev/rails,esparta/rails,jeremy/rails,kddeisz/rails,brchristian/rails,riseshia/railsguides.kr,BlakeWilliams/rails,tgxworld/rails,yawboakye/rails,Spin42/rails,kmayer/rails,joonyou/rails,stefanmb/rails,illacceptanything/illacceptanything,gavingmiller/rails,bogdanvlviv/rails,BlakeWilliams/rails,aditya-kapoor/rails,Vasfed/rails,sergey-alekseev/rails,pvalena/rails,mtsmfm/railstest,rbhitchcock/rails,aditya-kapoor/rails,repinel/rails,maicher/rails,Edouard-chin/rails,jeremy/rails,Erol/rails,tjschuck/rails,assain/rails,bogdanvlviv/rails,vassilevsky/rails,georgeclaghorn/rails,repinel/rails,mechanicles/rails,lcreid/rails,mechanicles/rails,odedniv/rails,riseshia/railsguides.kr,illacceptanything/illacceptanything,88rabbit/newRails,aditya-kapoor/rails,yalab/rails,Stellenticket/rails,sealocal/rails,illacceptanything/illacceptanything,rails/rails,deraru/rails,tgxworld/rails,vassilevsky/rails,samphilipd/rails,felipecvo/rails,tjschuck/rails,rafaelfranca/omg-rails,esparta/rails,samphilipd/rails,riseshia/railsguides.kr,ledestin/rails,kirs/rails-1,pvalena/rails,rails/rails,illacceptanything/illacceptanything,MichaelSp/rails,samphilipd/rails,felipecvo/rails,yawboakye/rails,deraru/rails,tjschuck/rails,rossta/rails,richseviora/rails,bradleypriest/rails,gavingmiller/rails,yahonda/rails,deraru/rails,fabianoleittes/rails,esparta/rails,rails/rails,Envek/rails,ttanimichi/rails,alecspopa/rails,prathamesh-sonpatki/rails,mathieujobin/reduced-rails-for-travis,rbhitchcock/rails,iainbeeston/rails,yasslab/railsguides.jp,tgxworld/rails,matrinox/rails,fabianoleittes/rails,kenta-s/rails,palkan/rails,prathamesh-sonpatki/rails,Vasfed/rails,betesh/rails,arunagw/rails,matrinox/rails,ngpestelos/rails,utilum/rails,gcourtemanche/rails,kmcphillips/rails,kaspth/rails,utilum/rails,joonyou/rails,mtsmfm/railstest,gauravtiwari/rails,EmmaB/rails-1,untidy-hair/rails,vipulnsward/rails,yahonda/rails,travisofthenorth/rails,vipulnsward/rails,bradleypriest/rails,mijoharas/rails,eileencodes/rails,iainbeeston/rails,printercu/rails,Sen-Zhang/rails,ledestin/rails,88rabbit/newRails,yawboakye/rails,arjes/rails,amoody2108/TechForJustice,Sen-Zhang/rails,schuetzm/rails,kddeisz/rails,Stellenticket/rails,lucasmazza/rails,hanystudy/rails,travisofthenorth/rails,starknx/rails,flanger001/rails,xlymian/rails,kachick/rails,Spin42/rails,MSP-Greg/rails,hanystudy/rails,esparta/rails,untidy-hair/rails,illacceptanything/illacceptanything,kmayer/rails,yalab/rails,gauravtiwari/rails,bogdanvlviv/rails,printercu/rails,MSP-Greg/rails,koic/rails,BlakeWilliams/rails,palkan/rails,baerjam/rails,richseviora/rails,odedniv/rails,mohitnatoo/rails,pschambacher/rails,yhirano55/rails,repinel/rails,betesh/rails,bogdanvlviv/rails,pvalena/rails,mohitnatoo/rails,eileencodes/rails,sergey-alekseev/rails,voray/rails,mtsmfm/rails,brchristian/rails,illacceptanything/illacceptanything,rails/rails,voray/rails,maicher/rails,jeremy/rails,gfvcastro/rails,prathamesh-sonpatki/rails,Stellenticket/rails,kddeisz/rails,bolek/rails,Vasfed/rails,shioyama/rails,printercu/rails,BlakeWilliams/rails,tgxworld/rails,mechanicles/rails,shioyama/rails,Edouard-chin/rails,yhirano55/rails,starknx/rails,betesh/rails,MichaelSp/rails,notapatch/rails,rafaelfranca/omg-rails,yalab/rails,gfvcastro/rails,notapatch/rails,illacceptanything/illacceptanything,fabianoleittes/rails,kddeisz/rails,yahonda/rails,betesh/rails,Erol/rails,eileencodes/rails,notapatch/rails,kenta-s/rails,pschambacher/rails,baerjam/rails,rafaelfranca/omg-rails,MSP-Greg/rails,Stellenticket/rails,coreyward/rails,yasslab/railsguides.jp,pvalena/rails,eileencodes/rails,xlymian/rails,kaspth/rails,kmayer/rails,mechanicles/rails,matrinox/rails,marklocklear/rails,elfassy/rails,bolek/rails,lcreid/rails,Spin42/rails,kamipo/rails,kamipo/rails,Edouard-chin/rails,kachick/rails,marklocklear/rails,ttanimichi/rails,vipulnsward/rails,mtsmfm/rails,illacceptanything/illacceptanything,illacceptanything/illacceptanything,assain/rails,palkan/rails,illacceptanything/illacceptanything,odedniv/rails,alecspopa/rails,ttanimichi/rails,kaspth/rails,ngpestelos/rails,elfassy/rails,joonyou/rails,assain/rails,lucasmazza/rails,richseviora/rails,felipecvo/rails,elfassy/rails,Erol/rails,georgeclaghorn/rails