Skip to content

Conversation

@Paxa
Copy link

@Paxa Paxa commented Dec 30, 2015

  • In simple cases DataTypeValidator.validate is slower then v.is_a?(ClassName)
  • %{< ... } is faster then str << ('<c r="' << ...)
  • values.size.times do |index| is faster then values.each_with_index do |value, index|
  • DateTimeConverter.date_to_serial ~ 1.8 times faster, because avoid creating date object and making rational calculation each time. I try date.to_time.to_i and date.strftime("%s").to_i - second is much faster. But it rounds to seconds

Overall improvement is small, but for each specific method about 50% faster when compare with benchmark-ips

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant