question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Taking Runtime observation repeatedly gets slower over time

See original GitHub issue

🐛 Bug

After creating an environment, taking the runtime observation from the same environment progressively takes more time to compute.

Log from the MRE below:

Completed in 61.9ms
Completed in 60.3ms
Completed in 92.3ms
Completed in 63.4ms
Completed in 60.7ms
Completed in 64.7ms
...
Completed in 223.1ms
Completed in 252.4ms
Completed in 237.7ms
Completed in 219.0ms
Completed in 221.4ms
Completed in 235.5ms

To Reproduce

Steps to reproduce the behavior:

  1. Create an environment.
  2. Repeatedly take the runtime observation.
import gym
import compiler_gym
from compiler_gym.util.timer import Timer

with gym.make('llvm-v0') as env:
    env.reset(benchmark='benchmark://cbench-v1/bitcount')
    while True:
        with Timer(f'Completed'):
            env.observation.Runtime()

Expected behavior

Taking the runtime observation repeatedly shouldn’t get slower progressively.

Environment

  • CompilerGym: development branch
  • How you installed CompilerGym (conda, pip, source): source
  • OS: Ubuntu 18.04 LTS
  • Python version: 3.9.6
  • Build command you used (if compiling from source): make bdist_wheel-linux

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ChrisCumminscommented, Sep 11, 2021

Hi @aymanizz, thanks for the report, and for the minimal repro script! I was able to successfully reproduce the problem on my end. Let me take a look a look at this next week and get back to you.

Cheers, Chris

0reactions
ChrisCumminscommented, Sep 17, 2021

#398 has been merged into development. Please update and let me know if you are able to reproduce the problem.

Cheers, Chris

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why do programs get slower with time? - Johnny's Software Lab
In this post we talk about the reasons why software becomes slower as new features are added or the data set size grows....
Read more >
Why is my SQL Server Query Suddenly Slow? | How To Fix
The first task is to investigate what was happening on the SQL Server over the time the application was running abnormally slowly.
Read more >
Why does runtime decrease the more times I execute a ...
Learn more about decreasing runtime. ... Some of the answer is the Just In Time compiler. ... Try measuring something that takes longer....
Read more >
Is there a way to circumvent Python list.append() becoming ...
The reporter observes that appending complex objects (objects that aren't numbers or strings) to a list slows linearly as the list grows in...
Read more >
Runtime slowdown when repeatedly fitting Prophet model in ...
Using Python, I noticed that when running a loop that fits a Prophet model in each iteration, each iteration seems to take an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found