Git Product home page Git Product logo

Comments (8)

vstinner avatar vstinner commented on July 23, 2024

from pyperf.

jdemeyer avatar jdemeyer commented on July 23, 2024

It is a deliberate choice to make results more reproducible between two computers.

How does blocking environment variables achieve that?

The only situation where such a blanket block of environment variables makes sense is for security reasons and that doesn't apply here. Another reason is changing/removing specific known-broken environment variables, but I don't think that this applies here either. In any case, the latter calls for a blacklist, not a whitelist.

I think that perf should run commands exactly the same way as in the usual Python environment. I don't see any reason to change environment variables at all, so whatever options are implemented, keeping the environment as-is should be the default.

from pyperf.

vstinner avatar vstinner commented on July 23, 2024

How does blocking environment variables achieve that?

For example, if you install a Python module on your machine and it's in the PYTHONPATH, the module can slowdown the benchmark, whereas the same benchmark on a similar machine without this module may be faster. Or it can be the opposite.

It's common that environment variables control optional features.

from pyperf.

vstinner avatar vstinner commented on July 23, 2024

@jdemeyer it's unclear to me if you still need to inherit the full environment or not. In case of doubt, I close the issue. If you want to move this forward, you can try to implement a change to add an option to implement that.

from pyperf.

jdemeyer avatar jdemeyer commented on July 23, 2024

I still think that it's a bug in perf that environment variables are blocked. But to be honest, I don't care enough to make a PR myself.

from pyperf.

vstinner avatar vstinner commented on July 23, 2024

Just one example. Depending on PYTHONPATH, you may or may not get additional .pth files which can change the behavior and impact performances.

from pyperf.

jdemeyer avatar jdemeyer commented on July 23, 2024

Depending on PYTHONPATH, you may or may not get additional .pth files which can change the behavior and impact performances.

Right, but that's a feature! I don't want code to suddenly behave differently if it's being profiled by perf. Instead, perf should just run the code that would normally be run by Python. If I set a PYTHONPATH, it means that I want to use it.

from pyperf.

vstinner avatar vstinner commented on July 23, 2024

(I reopen the discussion.)

perf helps you to identify what's unusal in your benchmark configuration to get reproducible results.

Removing environment variables idea comes from the old Python Grand Unified Benchmark Suite which late became http://pyperformance.readthedocs.io/ : new implementation (written by me) based on perf.

from pyperf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.