You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The attached patch adds an "-inplace" option to ocamlopt. When the option is set, it uses for all structures the same compilation scheme as is currently done for global structures only. This reduce pressure on the register allocater when compiling big structures.
The patch is careful to adapt the inliner to the new way of filling structure fields.
The program generated by the following code:
print_string "module F(X:sig val x : int end) = struct\n let x0 = X.x";;
for i = 1 to 300 do Printf.printf " let x%i = %i * x%i\n" i i (i-1) done;;
print_string "end";;
needs 15 seconds to compile with ocamlopt and 0.3s with option -inplace,
and the generated .o goes from 15044 bytes to 12740 bytes.
Le patch en pièce jointe ajoute une option "-inplace" à ocamlopt, dont l'effet
est d'utiliser le schéma de compilation des structures globales pour toutes les structures. Ça permet de réduire la pression sur l'allocateur de registres lorsque l'on compile de grosses structures.
Le patch prend soin d'adapter l'inliner pour qu'il comprenne la nouvelle manière de remplir les champs d'une structure.
Le programme produit par:
print_string "module F(X:sig val x : int end) = struct\n let x0 = X.x";;
for i = 1 to 300 do Printf.printf " let x%i = %i * x%i\n" i i (i-1) done;;
print_string "end";;
prend 15s à compiler avec ocamlopt et 0.3s avec l'option -inplace,
et le .o passe de 15044 octets à 12740 octets.
For the record, the patch compiles Ocamlr.ml for example in 7 seconds, against 21s without the patch. It is mostly the computation of the register interference graph which makes the difference.
Original bug ID: 4074
Reporter: @alainfrisch
Assigned to: @alainfrisch
Status: resolved (set by @alainfrisch on 2018-11-09T13:36:56Z)
Resolution: fixed
Priority: normal
Severity: feature
Category: back end (clambda to assembly)
Tags: patch
Related to: #5546 #5573 #7630
Monitored by: @whitequark @jmeber MIchaelWohlwend @hcarty @alainfrisch
Bug description
[edit: english translation]
The attached patch adds an "-inplace" option to ocamlopt. When the option is set, it uses for all structures the same compilation scheme as is currently done for global structures only. This reduce pressure on the register allocater when compiling big structures.
The patch is careful to adapt the inliner to the new way of filling structure fields.
The program generated by the following code:
print_string "module F(X:sig val x : int end) = struct\n let x0 = X.x";;
for i = 1 to 300 do Printf.printf " let x%i = %i * x%i\n" i i (i-1) done;;
print_string "end";;
needs 15 seconds to compile with ocamlopt and 0.3s with option -inplace,
and the generated .o goes from 15044 bytes to 12740 bytes.
Le patch en pièce jointe ajoute une option "-inplace" à ocamlopt, dont l'effet
est d'utiliser le schéma de compilation des structures globales pour toutes les structures. Ça permet de réduire la pression sur l'allocateur de registres lorsque l'on compile de grosses structures.
Le patch prend soin d'adapter l'inliner pour qu'il comprenne la nouvelle manière de remplir les champs d'une structure.
Le programme produit par:
print_string "module F(X:sig val x : int end) = struct\n let x0 = X.x";;
for i = 1 to 300 do Printf.printf " let x%i = %i * x%i\n" i i (i-1) done;;
print_string "end";;
prend 15s à compiler avec ocamlopt et 0.3s avec l'option -inplace,
et le .o passe de 15044 octets à 12740 octets.
File attachments
The text was updated successfully, but these errors were encountered: