8000 Lamac big execution time · Issue #5 · PLTools/Lama · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
8000
Skip to content
Lamac big execution time #5
Open
@merge34

Description

@merge34

Hello. During my progress in the compiler course I've encountered a possible bug in lamac.

Scenario

  1. Add case ... of construction to the code
  2. Add a considerable number (10+) of string patterns
  3. Add function call using dot notation after ->
  4. Run lamac <file name>

Problem
In the described scenario lamac execution time grows exponentially as the number of patterns grows.

Expected behavior
Execution time in the described scenario is similar to the execution time of lamac without dot notation usage.

Example
Consider the following gist, in which I've implemented 2 semantically equivalent programs, according to specification:

  1. In file example1.lama I've implemented the described scenario without dot notation usage. So, without any dependence on N, we have something like:
$ time lamac test.lama
real    0m8,152s                                                                                                                   
user    0m8,037s  
sys     0m0,102s
  1. In file example2.lama I've implemented exactly described scenario. So, we have:
  • N = 0
$ time lamac test.lama
real    0m0,227s  
user    0m0,219s 
sys     0m0,009s
  • N = 3
$ time lamac test.lama          
real    0m4,357s                    
user    0m4,289s                   
sys     0m0,067s
  • N = 5
$ time lamac test.lama 
real    1m23,222s 
user    1m22,964s
sys     0m0,223s
  • N = 7
    Did not finish after 10 minutes of execution

Environment description

  • Ubuntu 18.04
  • Opam 2.0.5
  • OCaml 4.0.5
  • gcc-multilib 7.4.0

Metadata

Metadata

Assignees

Labels

test caseWitnesses an error in other library

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0