unshiftio / tick-tock

Timer management, never forget to clear timers again.
http://unshift.io
MIT License
17 stars 8 forks source link

Remove the type property from the timer object #3

Closed lpinca closed 9 years ago

lpinca commented 9 years ago

Reasons for this change:

  1. We don't need a type property.
  2. Object literals are slightly faster.
  3. The size of the library is slightly smaller.
coveralls commented 9 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 9cf7c94450a6838dadf86e15c9ddb46a8c87f971 on remove-type-property into e73ba567e62a35ff9b8caa9ccd0ed3d19357c683 on master.

coveralls commented 9 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 9cf7c94450a6838dadf86e15c9ddb46a8c87f971 on remove-type-property into e73ba567e62a35ff9b8caa9ccd0ed3d19357c683 on master.

3rd-Eden commented 9 years ago

The Timer instances makes it easier to V8 to optimize as every timer object will have the same underlaying class and therefor reducing memory required and the work that V8 has to do.

3rd-Eden commented 9 years ago

But I agree that the type properties are not needed as we can directly check against the fn instead. So I'm going to close this pull request and incorporate the changes directly in to master.