Thank you for the explanations @RespiteSage. I will not insist, using a method works perfectly fine for me and it’s faster. At first I thought that constants were faster because it’s a simple value stored in memory that never change and a method, slower, because it involves some logic. But it seems to be the opposite.

I had to evaluate a polynomial with constant coefficients and storing the coefficients into a method is 2.7x faster than a constant.

```
require "benchmark"
COEF = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0}
def coef
{1.0, 2.0, 3.0, 4.0, 5.0, 6.0}
end
def polevl(x, c)
c[0] +
c[1] * x +
c[2] * x**2 +
c[3] * x**3 +
c[4] * x**4 +
c[5] * x**5
end
x = Random.new.rand(1.0..10.0)
c = m = 0.0
Benchmark.ips(warmup: 0.01, calculation: 0.1) do |b|
b.report("constant") {c = polevl(x, COEF)}
b.report("method") {m = polevl(x, coef)}
end
puts c
puts m
```

Output:

```
constant 85.94M ( 11.64ns) (± 1.67%) 0.0B/op 2.74× slower
method 235.07M ( 4.25ns) (± 2.25%) 0.0B/op fastest
```