sstephenson/sprockets — pull request #428 by SamSaffron (2013-04-08 05:01:32+00:00)
Title: Fix serialization format for mtime on files 

I noticed that file digests were being calculated like madness EVERY request in dev mode.

![BHSTWZGCEAExhAM](https://f.cloud.github.com/assets/5213/350093/9e15f948-a008-11e2-944a-978ed372d967.png)

This all boils down to mtimes being serialized with a serializer that was chucking out precision.

This fix is backwards compatible, though to get proper performance users are encouraged to nuke the /tmp/cache folder.

Results for Discourse in Dev.

Before:

![before](https://f.cloud.github.com/assets/5213/350102/ea92a776-a008-11e2-9e91-fdc004d6b783.PNG)

After:

![after](https://f.cloud.github.com/assets/5213/350110/21fe0d18-a009-11e2-85f6-b01d179227fc.PNG)

That is a 110ms improvement. There is another 20ms or so lurking in porting the .stat calls to pure mtime, cause you don't really need full stats.

---

Ruby Time ... the more you know:

```ruby
[1] pry(main)> t=Time.now;t==Time.at(t.to_i)
=> false

[2] pry(main)> t=Time.now;t==Time.parse(t.iso8601)
=> false

[3] pry(main)> t=Time.now;t==Time.at(t.to_r)
=> true
```