bencheeorg / benchee

Easy and extensible benchmarking in Elixir providing you with lots of statistics!
MIT License
1.42k stars 66 forks source link

Trying to round :infinity #328

Closed Cantido closed 2 years ago

Cantido commented 4 years ago

When I run the benchmark in this file, I frequently get this stacktrace. It usually happens with the equal?/2 benchmark.

** (FunctionClauseError) no function clause matching in Float.round/2
    (elixir 1.11.0) lib/float.ex:259: Float.round(:infinity, 2)
    (stdlib 3.8) erl_eval.erl:680: :erl_eval.do_apply/6
    (stdlib 3.8) erl_eval.erl:449: :erl_eval.expr/5
    (elixir 1.11.0) src/elixir.erl:278: :elixir.recur_eval/3
    (elixir 1.11.0) src/elixir.erl:263: :elixir.eval_forms/3
    (elixir 1.11.0) lib/code.ex:706: Code.eval_quoted/3
    (eex 1.11.0) lib/eex.ex:235: EEx.do_eval/3
    (elixir 1.11.0) lib/enum.ex:1399: Enum."-map/2-lists^map/1-0-"/2
PragTob commented 4 years ago

:wave:

Hey, thanks for the bug report. I wonder what edge case causes this on what thing :thinking:

We're overdue for a release but I first really wanna fix that pesky mac issue alas I don't really want to fix it :D

we'll see what we can find and sorry for the inconvenience :(

Cantido commented 4 years ago

hey no worries :)

Qqwy commented 3 years ago

I encountered this error as well. It was reproducible by enabling memory_time on operations that took significantly long to complete. Not sure whether that is where it originates, but maybe it helps :man_shrugging:

PragTob commented 2 years ago

Hey. I'm a bit back in the game and hopefully can take a look after I make a release happen.

I wonder if we get something somewhere to return 0, do a division and then this whole mess starts. This of course absolutely should not be happening.

Qqwy commented 2 years ago

What I think that might happen, is that something takes too long, then is rounded to significance (like the number of iterations per second), which in that case becomes 0. And then we end up with :infinity elsewhere.

On February 19, 2022 5:27:10 PM UTC, Tobias Pfeiffer @.***> wrote:

Hey. I'm a bit back in the game and hopefully can take a look after I make a release happen.

I wonder if we get something somewhere to return 0, do a division and then this whole mess starts. This of course absolutely should not be happening.

-- Reply to this email directly or view it on GitHub: https://github.com/bencheeorg/benchee/issues/328#issuecomment-1046066426 You are receiving this because you commented.

Message ID: @.***> -- Met vriendelijke groet / Sincerely, ~W-M

PragTob commented 2 years ago

@Qqwy I see EEx in the stacktrace. That should not be there unless it's the HTML formatter, but I also see @Cantido was using the Markdown formatter which probably also uses EEx. Are you also using the Markdown formatter in your example? That might be a hint then :)

PragTob commented 2 years ago

Can't run the initial benchmarks, apparently 32GB memory is not enough :sweat_smile:

NickNeck commented 2 years ago

@PragTob I have fixed a bug around :infinity in benchee_markdown a while ago, see https://github.com/hrzndhrn/benchee_markdown/commit/2c9b10793d022296764ac359778cfc5afd318bf8 . Edit: I just realized that I even made the fix especially for @Cantido, see https://github.com/Cantido/int_set/pull/19 .

PragTob commented 2 years ago

@NickNeck thanks a lot! :green_heart:

I'll wait to hear if @Qqwy also used/uses benchee_markdown and if yes close this one out :)

Qqwy commented 2 years ago

Correct, I was also using benchee_markdown at the time :+1:

PragTob commented 2 years ago

Closssinnng, thanks all! WhatsApp Image 2021-10-31 at 09 15 39