rbenv-ruby-build/script/test
Jean Boussier 1f9b792168 macOS: Use GMP from homebrew
MRI's BigInt use GMP under the hood if available, and if not
fallbacks to an homemade implementation with much worse performance.

Without GMP:
```
>> Benchmark.realtime { Integer('1' * (10 ** 7)) }
=> 13.80743500002427
```

With GMP
```
>> Benchmark.realtime { Integer('1' * (10 ** 7)) }
=> 0.4098639999865554
```

macOS not being a common production platform, it's not a huge deal
but it would still preferable to compile with `gmp.h` if present.

I'd also suggest to print a warning if compiling on macOS and gmp
isn't installed, but I don't know if it's desirable.

NB: `--with-gmp-dir` was only added recently, so this will only
apply to MRI >= 3.2, as well as rubies on which this flag was backported.
2022-09-22 08:56:34 +02:00

4 lines
48 B
Bash
Executable file

#!/bin/bash
set -e
bats ${CI:+--tap} test "$@"