Jump to page: 1 2 3
Thread overview
Humble benchmark (fisher's exact test)
Aug 14, 2021
Ki Rill
Aug 14, 2021
Ali Çehreli
Aug 14, 2021
zjh
Aug 14, 2021
John Colvin
Aug 14, 2021
Ki Rill
Aug 15, 2021
Ki Rill
Aug 15, 2021
max haughton
Aug 14, 2021
Jacob Shtokolov
Aug 14, 2021
bachmeier
Aug 14, 2021
Ki Rill
Aug 23, 2021
bachmeier
Aug 23, 2021
russhy
Aug 23, 2021
bachmeier
Aug 23, 2021
russhy
Aug 24, 2021
Alexandru Ermicioi
Aug 24, 2021
Bienlein
Aug 24, 2021
russhy
Aug 24, 2021
Paulo Pinto
Aug 24, 2021
russhy
Aug 24, 2021
Bienlein
Aug 14, 2021
Guillaume Piolat
Aug 14, 2021
Tejas
Aug 14, 2021
Guillaume Piolat
Aug 14, 2021
max haughton
Aug 14, 2021
max haughton
Aug 14, 2021
max haughton
Aug 23, 2021
Imperatorn
Aug 23, 2021
russhy
Aug 23, 2021
H. S. Teoh
August 14, 2021

It's a simple benchmark examining:

  • execution time (sec)
  • memory consumption (kb)
  • binary size (kb)
  • conciseness of a programming language (lines of code)

Link

August 13, 2021
On 8/13/21 7:19 PM, Ki Rill wrote:
> It's a simple benchmark examining:
> * execution time (sec)
> * memory consumption (kb)
> * binary size (kb)
> * conciseness of a programming language (lines of code)
> 
> [Link](https://github.com/rillki/humble-benchmarks/tree/main/fishers-exact-test) 
> 

The most obvious improvement I can see is removing the dynamic array creations in a loop. Since that array seems to be very short, using a static array would improve performance. (Ok, now I see that you already do that for the betterC and nogc versios.)

Also, I wonder how disabling GC collections would affect execution time and memory consumption:

  https://dlang.org/spec/garbage.html#gc_config

Ali
August 14, 2021

On Saturday, 14 August 2021 at 02:19:02 UTC, Ki Rill wrote:

>

It's a simple benchmark examining:

Das betterC is very competitive.d should invest 'resources' in this.

August 14, 2021

On Saturday, 14 August 2021 at 02:19:02 UTC, Ki Rill wrote:

>

It's a simple benchmark examining:

  • execution time (sec)
  • memory consumption (kb)
  • binary size (kb)
  • conciseness of a programming language (lines of code)

Link

Lots of things to improve there.

https://github.com/rillki/humble-benchmarks/pull/4

A nice quick morning exercise :)

August 14, 2021

On Saturday, 14 August 2021 at 10:26:52 UTC, John Colvin wrote:

>

On Saturday, 14 August 2021 at 02:19:02 UTC, Ki Rill wrote:

>

It's a simple benchmark examining:

  • execution time (sec)
  • memory consumption (kb)
  • binary size (kb)
  • conciseness of a programming language (lines of code)

Link

Lots of things to improve there.

https://github.com/rillki/humble-benchmarks/pull/4

A nice quick morning exercise :)

Thanks!

August 14, 2021

On Saturday, 14 August 2021 at 02:19:02 UTC, Ki Rill wrote:

>
  • binary size (kb)

Regarding the binary size: please make sure that you're using dynamic linking for the D package, as by default it always links statically, while libc and libc++ are always linked dynamically.

August 14, 2021

On Saturday, 14 August 2021 at 02:19:02 UTC, Ki Rill wrote:

>

It's a simple benchmark examining:

  • execution time (sec)
  • memory consumption (kb)
  • binary size (kb)
  • conciseness of a programming language (lines of code)

Link

I'm skeptical that you're measuring what you think you're measuring. I say this because the R version shouldn't be that much slower than the C version. All that happens when you call fisher.test is that it checks which case it's handling and then calls the builtin C function. For example, this line.

More likely a chunk of your C code is being eliminated by the optimizer. Another thing is that printing to the screen is much slower in R than in C. You shouldn't benchmark printing to the screen since that is not something you would ever do in practice. If you really want performance, you can determine which case applies to your code and then make the underlying .Call yourself. If you don't do that, you're comparing Fisher's exact test against a routine that does a lot more than Fisher's exact test. In any event, you're not comparing against an R implementation of this test.

August 14, 2021

On Saturday, 14 August 2021 at 12:48:05 UTC, bachmeier wrote:

>

On Saturday, 14 August 2021 at 02:19:02 UTC, Ki Rill wrote:
More likely a chunk of your C code is being eliminated by the optimizer. Another thing is that printing to the screen is much slower in R than in C. You shouldn't benchmark printing to the screen since that is not something you would ever do in practice.

It happens at the end of the program only once and takes a fraction of a second. I consider it to be irrelevant here.

>

If you really want performance, you can determine which case applies to your code and then make the underlying .Call yourself. If you don't do that, you're comparing Fisher's exact test against a routine that does a lot more than Fisher's exact test. In any event, you're not comparing against an R implementation of this test.

That is the point of this benchmark, to test it against Python/R implementation irrespective of what it does additionally. And to test compiled languages in general.

August 14, 2021

On Saturday, 14 August 2021 at 02:19:02 UTC, Ki Rill wrote:

>

It's a simple benchmark examining:

  • execution time (sec)
  • memory consumption (kb)
  • binary size (kb)
  • conciseness of a programming language (lines of code)

Link

Using the intel-intrinsics package you can do 4x exp or log operations at once.

August 14, 2021

On Saturday, 14 August 2021 at 02:19:02 UTC, Ki Rill wrote:

>

It's a simple benchmark examining:

  • execution time (sec)
  • memory consumption (kb)
  • binary size (kb)
  • conciseness of a programming language (lines of code)

Link

If anyone is wondering why the GDC results look a bit weird: It's because GDC doesn't actually inline unless you compile with LTO or enable whole program optimization (The rationale is due to the interaction of linking with templates).

https://godbolt.org/z/Gj8hMjEch play with removing the '-fwhole-program' flag on that link.

« First   ‹ Prev
1 2 3