hash-org / hash-org/hashc

tc: exp-time whilst running analysis on this chunk

Open
#981 0 comments 1 reaction 0 assignees View on GitHub
bug performance type-system
Dominant language
Rust
Stars
28
Forks
1
PR merge metrics
No merged PRs in 30d

Description

The following snippet (with the addition of more `+ 1`) causes the compiler to exhibit exponential compile times (specifically in the analysis phase).

```rust
main := () => {
y := 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 +
1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1;
} // 170ms
```

The above snippet took `170ms` to evaluate, and the one below took `310ms`, and the one after `600ms`:

```rust
main := () => {
y := 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 +
1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 +
1;
} // 310ms
```

```rust
main := () => {
y := 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 +
1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 +
1 + 1;
} // 600ms
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.