Skip to content

Commit f976d41

Browse files
committed
Enable flambda by default
1 parent 5f48af5 commit f976d41

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed

jscomp/bench.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//@ts-check
2+
var cp = require("child_process");
3+
4+
var output = cp.execSync(`ninja -t commands test/ocaml_typedtree_test.cmj`, {
5+
encoding: "utf8"
6+
});
7+
8+
var toDO = output
9+
.split("\n")
10+
.filter(x => x.trim())
11+
.pop()
12+
.replace(".exe", ".darwin");
13+
14+
console.log(cp.execSync(`time ${toDO}`, { encoding: "utf8" }));
15+
16+
/*
17+
real 0m3.658s
18+
user 0m3.562s
19+
sys 0m0.089s
20+
*/

scripts/buildocaml.js

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ function build(config) {
6363

6464
if (config) {
6565
cp.execSync(
66-
"./configure -prefix " +
66+
"./configure -flambda -prefix " +
6767
prefix +
6868
" -no-ocamlbuild -no-curses -no-graph -no-pthread -no-debugger && make clean",
6969
{ cwd: ocamlSrcDir, stdio: [0, 1, 2] }

scripts/ninjaFactory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ext = ${config.ext}
1414
INCL = ${config.INCL}
1515
flags = -nodynlink -I $INCL -g -w -a ../jscomp/stubs/ext_basic_hash_stubs.c
1616
rule cc
17-
command = $ocamlopt $flags $in -o $out ${config.isWin? '' : '&& strip $out'}
17+
command = $ocamlopt -O2 $flags $in -o $out ${config.isWin? '' : '&& strip $out'}
1818
description = Making $out
1919
# -inline 1000 makes size too large
2020
# TODO: make sure it can be bootstrapped, at least is a very good

vendor/ocaml.tar.gz

1.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)