| Anonymous | Login | Signup for a new account | 2013-05-22 11:07 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | |||
| 0005944 | OCaml | OCaml typing | public | 2013-03-12 14:45 | 2013-04-23 02:38 | |||
| Reporter | bvaugon | |||||||
| Assigned To | garrigue | |||||||
| Priority | normal | Severity | minor | Reproducibility | always | |||
| Status | closed | Resolution | fixed | |||||
| Platform | OS | OS Version | ||||||
| Product Version | 4.00.1 | |||||||
| Target Version | Fixed in Version | 4.00.2+dev | ||||||
| Summary | 0005944: [patch] Bad typing performances of big variant type declaration | |||||||
| 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). | |||||||
| Tags | No tags attached. | |||||||
| Attached Files | ||||||||
Notes |
|
|
(0008961) garrigue (manager) 2013-03-12 15:15 |
Well, this is really a huge type... Your patch is small, so I will probably include it. My only concern is that you may get into other performance problems using this type. |
|
(0008962) bvaugon (reporter) 2013-03-12 17:37 |
Yes, it's not impossible. But in practice, for now, I uses types like this in multiple programs without other compilation problems. Thanks for your answer! |
|
(0009189) garrigue (manager) 2013-04-23 02:38 |
Patch merge in trunk and 4.00, revision 13588 and 13589. |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2013-03-12 14:45 | bvaugon | New Issue | |
| 2013-03-12 14:45 | bvaugon | File Added: ocaml-4.00.1-fast-typedecl.diff | |
| 2013-03-12 15:15 | garrigue | Note Added: 0008961 | |
| 2013-03-12 15:15 | garrigue | Assigned To | => garrigue |
| 2013-03-12 15:15 | garrigue | Status | new => assigned |
| 2013-03-12 17:37 | bvaugon | Note Added: 0008962 | |
| 2013-04-23 02:38 | garrigue | Note Added: 0009189 | |
| 2013-04-23 02:38 | garrigue | Status | assigned => closed |
| 2013-04-23 02:38 | garrigue | Resolution | open => fixed |
| 2013-04-23 02:38 | garrigue | Fixed in Version | => 4.00.2+dev |
| Copyright © 2000 - 2011 MantisBT Group |