JuliaLang / Microbenchmarks

Microbenchmarks comparing the Julia Programming language with other languages
https://julialang.org/benchmarks/
Other
88 stars 48 forks source link

Why C benchmark is not compile with optimisation ? #3

Closed Stargateur closed 6 years ago

Stargateur commented 6 years ago

In Makefile, we can see https://github.com/JuliaLang/Microbenchmarks/blob/master/Makefile#L58

First I don't really understand why $* is here because doc say:

$* The stem with which an implicit rule matches (see How Patterns Match). If the target is dir/a.foo.b and the target pattern is a.%.b then the stem is dir/foo. The stem is useful for constructing names of related files.

In a static pattern rule, the stem is part of the file name that matched the ‘%’ in the target pattern.

In an explicit rule, there is no stem; so ‘$’ cannot be determined in that way. Instead, if the target name ends with a recognized suffix (see Old-Fashioned Suffix Rules), ‘$’ is set to the target name minus the suffix. For example, if the target name is ‘foo.c’, then ‘$’ is set to ‘foo’, since ‘.c’ is a suffix. GNU make does this bizarre thing only for compatibility with other implementations of make. You should generally avoid using ‘$’ except in implicit rules or static pattern rules.

If the target name in an explicit rule does not end with a recognized suffix, ‘$*’ is set to the empty string for that rule.

On my OS, it's produce O0, that mean compile the code as fast as possible don't lost time on optimisation. I don't think, it's what we want.

Secondly, I think we should compare benchmark between them in release mode, so O3.

Stargateur commented 6 years ago

NEVER MIND