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
Original bug ID: 5944 Reporter: bvaugon Assigned to:@garrigue Status: closed (set by @garrigue on 2013-04-23T00:38:42Z) Resolution: fixed Priority: normal Severity: minor Version: 4.00.1 Fixed in version: 4.00.2+dev Category: typing
Bug description
The typing complexity of variant type declaration like:
type t = X1 | X2 | X3 | [...] | X32768
is very bad.
This kind of code pattern is somtime usefull, in particular in OCaPIC low level libraries, and it can be fixed by the small and simple attached patch.
Steps to reproduce
Insert this kind of type declaration in a x.mli file and run:
time ocamlopt x.mli
Additional information
The culprit function is check_constraints defined in typing/typedecl.ml.
A small "Map" index resolve the problem, as you can see in the attached patch:
ocaml-4.00.1-fast-typedecl.diff.
With this patch, the time needed to compile a variant definition with 32768 constant constructors go down from 29s to 0.39s (on my computer).
Original bug ID: 5944
Reporter: bvaugon
Assigned to: @garrigue
Status: closed (set by @garrigue on 2013-04-23T00:38:42Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.00.1
Fixed in version: 4.00.2+dev
Category: typing
Bug description
The typing complexity of variant type declaration like:
type t = X1 | X2 | X3 | [...] | X32768
is very bad.
This kind of code pattern is somtime usefull, in particular in OCaPIC low level libraries, and it can be fixed by the small and simple attached patch.
Steps to reproduce
Insert this kind of type declaration in a x.mli file and run:
time ocamlopt x.mli
Additional information
The culprit function is check_constraints defined in typing/typedecl.ml.
A small "Map" index resolve the problem, as you can see in the attached patch:
ocaml-4.00.1-fast-typedecl.diff.
With this patch, the time needed to compile a variant definition with 32768 constant constructors go down from 29s to 0.39s (on my computer).
File attachments
The text was updated successfully, but these errors were encountered: