rtomayko/time-8601 — pull request #1 by vmg (2013-02-27 15:58:40+00:00)
Title: Performance fixes

Hey! I've made some performance tweaks. They basically amount to not-going-into-Rubyland if it's not strictly necessary, because that creates extra objects all the time, which sucks.

Benches:

```
==> ISO8601 performance
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
user system total real
Baselines (1000x)
1 + 1 0.000000 0.000000 0.000000 ( 0.000075)
Time::new 0.000000 0.000000 0.000000 ( 0.000487)
Time::new without tz offset 0.010000 0.000000 0.010000 ( 0.006840)
Time::new with tz offset 0.000000 0.000000 0.000000 ( 0.003592)
Time::utc 0.000000 0.010000 0.010000 ( 0.004019)
Time::mktime 0.010000 0.010000 0.020000 ( 0.013097)
Time::at with int 0.000000 0.000000 0.000000 ( 0.000473)
Time::at with int and utc convert 0.000000 0.000000 0.000000 ( 0.002321)
Time::at with int and local convert 0.000000 0.000000 0.000000 ( 0.002717)
Time::at with usecs 0.000000 0.000000 0.000000 ( 0.001488)

Parsing 2013-02-25T01:48:14 (1000x)
Time::iso8601_strict 0.000000 0.000000 0.000000 ( 0.002193)
Time::iso8601_strptime 0.010000 0.000000 0.010000 ( 0.006809)
Time::iso8601 0.010000 0.000000 0.010000 ( 0.010647)
Marshal::load 0.000000 0.010000 0.010000 ( 0.008486)

Parsing 2013-02-25T01:48:14Z (1000x)
Time::iso8601_strict 0.000000 0.000000 0.000000 ( 0.002214)
Time::iso8601_strptime 0.010000 0.000000 0.010000 ( 0.004994)
Time::iso8601 0.010000 0.000000 0.010000 ( 0.014905)
Marshal::load 0.010000 0.000000 0.010000 ( 0.004868)

Parsing 2013-02-25T01:48:14-05:00 (1000x)
Time::iso8601_strict 0.000000 0.000000 0.000000 ( 0.003787)
Time::iso8601_strptime 0.000000 0.000000 0.000000 ( 0.004982)
Time::iso8601 0.010000 0.010000 0.020000 ( 0.017282)
Marshal::load 0.010000 0.000000 0.010000 ( 0.004726)

GC: 1 runs, 0.000000s
````

Note that the only path that is "slow" now is the one with explicit timezones, because we still have to use the long `rb_funcall` to instantiate that. I've been looking at a workaround, but found nothing so far.