Skip to content

Commit

Permalink
Comment out the performance test for now
Browse files Browse the repository at this point in the history
  • Loading branch information
kipcole9 committed Feb 22, 2019
1 parent 54da529 commit 527021a
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions test/performance_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ defmodule MoneyTest.Performance do
# This is fixed to a single machine spec which is not good.
# A proper approach is required.

@acceptable_limit 76_000
@acceptable_tolerance 0.02
@iterations 1000
@acceptable_range trunc(@acceptable_limit * (1 - @acceptable_tolerance))..
trunc(@acceptable_limit * (1 + @acceptable_tolerance))

test "that performance on rounding hasn't degraded" do
m = Money.new(:USD, "2.04")
{millseconds, :ok} = :timer.tc(fn ->
Enum.each(1..@iterations, fn _x ->
Money.round(m)
end)
end)
assert millseconds in @acceptable_range
end
# @acceptable_limit 76_000
# @acceptable_tolerance 0.02
# @iterations 1000
# @acceptable_range trunc(@acceptable_limit * (1 - @acceptable_tolerance))..
# trunc(@acceptable_limit * (1 + @acceptable_tolerance))
#
# test "that performance on rounding hasn't degraded" do
# m = Money.new(:USD, "2.04")
# {millseconds, :ok} = :timer.tc(fn ->
# Enum.each(1..@iterations, fn _x ->
# Money.round(m)
# end)
# end)
# assert millseconds in @acceptable_range
# end
end

0 comments on commit 527021a

Please sign in to comment.