Git Product home page Git Product logo

specialist's Introduction

I'm a computer-engineer-turned-software-engineer, heavily involved in CPython development.


Building a JIT compiler for CPython
PyCon US 2024
May 19th, 2024

PEP 744 – JIT Compilation
Python Enhancement Proposals
April 11th, 2024

A tour of CPython's runtime
University of California, Irvine
March 11th, 2024


2023

A JIT compiler for CPython
CPython Core Dev Sprint 2023
October 10th, 2023

Inside CPython 3.11's new specializing, adaptive interpreter
PyCon US 2023
April 21st, 2023

A tour of CPython's bytecode compiler
University of California, Irvine
March 14th, 2023


2022

Python 3.11 Release Episode
Talk Python
October 28th, 2022

A Team at Microsoft is Helping Make Python Faster
Microsoft Python DevBlog
October 26th, 2022

Making CPython 3.11 Especially Fast
Python 3.11 Release
October 24th, 2022

Python Perf: Specializing, Adaptive Interpreter
Talk Python
September 15th, 2022

A Perfect match
PyCon US 2022
April 29th, 2022


2021

A Perfect match
PyCon JP 2021
October 16th, 2021

Structural Pattern Matching
Python 3.10 Release Stream
October 4th, 2021

What's New in Python 3.10
PyCharm by JetBrains
October 4th, 2021


2020

Dynamic Pattern Matching with Python
Dynamic Languages Symposium 2020
November 15th, 2020

PEP 634 – Structural Pattern Matching: Specification
Python Enhancement Proposals
September 12th, 2020

PEP 622 – Structural Pattern Matching
Python Enhancement Proposals
June 23rd, 2020

PEP 618 – Add Optional Length-Checking To zip
Python Enhancement Proposals
May 1st, 2020

PEP 614 – Relaxing Grammar Restrictions On Decorators
Python Enhancement Proposals
February 10th, 2020


2019

PEP 584 – Add Union Operators To dict
Python Enhancement Proposals
March 1st, 2019

specialist's People

Contributors

brandtbucher avatar cclauss avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

specialist's Issues

Not all adaptive instructions are bad

This is a cool tool!

It looks like all the color coding is currently done in the ROYG range. Redder means less specialized, greener means more specialized.

But code can be unspecialized either because it wasn't run enough, or because it was run enough but had some other issue. The former case isn't very interesting, while the latter is potentially actionable.

So I suggest using red just for things that could be specialized but aren't, and BIV colors for things that aren't specialized for boring reasons (not run enough, implemented in C, etc). This will make it immediately clear where the problem areas are.

Output fails when targets matches a single file

Running something like

python -m specialist --output specialist --targets example/__init__.py example/__init__.py

fails with

  File "/lib64/python3.11/site-packages/specialist.py", line 443, in <genexpr>
    (path_, output / path_.relative_to(common).with_suffix(".html"))
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/pathlib.py", line 694, in with_suffix
    raise ValueError("%r has an empty name" % (self,))
ValueError: PosixPath('.') has an empty name

It seems the problem is in

                common = pathlib.Path(
                    os.path.commonpath(paths)  # pylint: disable = no-member
                ).resolve()

This assumes there is more than one file and common will end up as a directory.

Adding this right below seems to fix it

                if not common.is_dir():
                    common = common.parent

An alternative method would be to check the length of paths.

"ValueError: Paths don't have the same drive" for all invocations of specialist

I get the following error no matter how I try to invoke specialist:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "D:\Dev\conway-2023\.env\Scripts\specialist.exe\__main__.py", line 4, in <module>
    import shutil
    ^^^^^^^^^^^^^^
  File "D:\Dev\conway-2023\.env\Lib\site-packages\specialist.py", line 78, in <module>
    os.path.commonpath([sysconfig.get_path("stdlib"), sysconfig.get_path("purelib")])
  File "<frozen ntpath>", line 814, in commonpath
ValueError: Paths don't have the same drive

The experience of using `-m` could be improved

Amazing tool! The documentation is good but it was a bit confusing when it came to integration with pytest. I would run the following:

specialist -m pytest ./tests/test_file.py

which would get me the result:

specialist: No quickened code found in pytest! Try modifying it to run longer, or use the --targets option to analyze different source files.

what wasn't clear was the --targets meant the source code I wanted to see was quickened. I think I was assuming it would automatically know which classes I meant (how would it??). It wasn't until I figured out the following syntax that I started getting incredibly helpful results!

specialist --targets ./module/class_the_test_exercises.py -m pytest ./tests/test_file.py

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.