Skip to content

🌍 #349 Improve integer generator run performance by 30-35%#354

Merged
nth-commit merged 1 commit into
mainfrom
terra/performance-3
Aug 10, 2022
Merged

🌍 #349 Improve integer generator run performance by 30-35%#354
nth-commit merged 1 commit into
mainfrom
terra/performance-3

Conversation

@nth-commit

Copy link
Copy Markdown
Owner

We cache the work when we create an int gen, but inside a SelectMany, we're creating a new gen every iteration.

Lazily calculate the bounds ranges.

Before:

|                Method |      Mean |     Error |    StdDev |
|---------------------- |----------:|----------:|----------:|
|         SelectManyGen | 31.904 us | 0.5425 us | 0.8120 us |
| SelectManyGenBaseline |  9.950 us | 0.1692 us | 0.1500 us |

After:

|                Method |      Mean |     Error |    StdDev |
|---------------------- |----------:|----------:|----------:|
|         SelectManyGen | 20.077 us | 0.3833 us | 0.4101 us |
| SelectManyGenBaseline |  9.833 us | 0.1924 us | 0.2363 us |

We cache the work when we create an int gen, but inside a SelectMany, we're creating a new gen every iteration.

Lazily calculate the bounds ranges.

Before:

```
|                Method |      Mean |     Error |    StdDev |
|---------------------- |----------:|----------:|----------:|
|         SelectManyGen | 31.904 us | 0.5425 us | 0.8120 us |
| SelectManyGenBaseline |  9.950 us | 0.1692 us | 0.1500 us |
```

After:

```
|                Method |      Mean |     Error |    StdDev |
|---------------------- |----------:|----------:|----------:|
|         SelectManyGen | 20.077 us | 0.3833 us | 0.4101 us |
| SelectManyGenBaseline |  9.833 us | 0.1924 us | 0.2363 us |
```
@nth-commit
nth-commit merged commit e65633e into main Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant