2007-10-24

Time.now is slow?

It's said on Rails Tokyo meeting on 10/21.

He created a Rails application and profiled it with ruby-prof. He found that Time.now in a deep loop exhausts much time so he wrote an extension that did gettimeofday() to get Epoch elapsed time in float. It solves performance problem of his Rail application.

time_init in time.c just executes gettimeofday() and construct an object. What else do we need?!

No comments: