Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small performance improvements #438

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Small performance improvements #438

wants to merge 4 commits into from

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