plasma-umass / scalene

Scalene: a high-performance, high-precision CPU, GPU, and memory profiler for Python with AI-powered optimization proposals
Apache License 2.0
12.1k stars 395 forks source link

Scalene is incompatible with Selenium #424

Open pedroig opened 2 years ago

pedroig commented 2 years ago

Describe the bug I’m unable to instantiate the selenium driver when running through scalene.

To Reproduce

  1. Create a file named example.py with the script below:
    
    from selenium.webdriver import Chrome, ChromeOptions

if name == "main": opts = ChromeOptions() opts.headless = True

with Chrome(options=opts) as driver:
    driver.get("https://www.google.com/")
2. Run `scalene example.py``
3. The following error message should appear:

Error in program being profiled: Message: Service chromedriver unexpectedly exited. Status code was: -11



**Expected behavior**
Successfully run the script with the profiling results.

**Desktop (please complete the following information):**
 - OS: macOS Monterey version 12.5
 - Browser: chrome version 104.0.5112.101
 - selenium==4.4.0
 - scalene==1.5.10
 - Python 3.9.10
DHolmanCoding commented 1 week ago

I have also encountered this exact same issue trying to profile a selenium based program. Did you ever get any information on whether the maintainers have seen this or are trying to investigate it?

DHolmanCoding commented 1 week ago

@emeryberger Hello sir, I just wanted to make you aware of this issue and wonder if this particular issue will get addressed or if there is a current workaround in place. Thanks for blessing us with this wonderful tool