GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-97670: Remove sys.getdxp() and analyze_dxp.py script by vstinner · Pull Request #97671 · python/cpython

Conversation

@vstinner

@vstinner vstinner commented Sep 30, 2022 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Remove the sys.getdxp() function and the Tools/scripts/analyze_dxp.py script. DXP stands for "dynamic execution pairs". They were related to DYNAMIC_EXECUTION_PROFILE and DXPAIRS macros which have been removed in Python 3.11. Python can now be built with "./configure --enable-pystats" to gather statistics on Python opcodes.

  • Issue: Remove sys.getdxp() and Tools/scripts/analyze_dxp.py: superceded by Py_STATS infra #97670

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vstinner
vstinner requested a review from markshannon as a code owner September 30, 2022 11:33
@bedevere-bot bedevere-bot added the awaiting core review label Sep 30, 2022
@vstinner

vstinner commented Sep 30, 2022

Copy link
Copy Markdown
Member Author

@markshannon: Would you mind to review this PR?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Oct 3, 2022

Copy link
Copy Markdown
Member Author

@brandtbucher: Would you mind to review this PR?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@markshannon

markshannon commented Oct 3, 2022

Copy link
Copy Markdown
Member

Removing the script seems fine.
Do we know for sure that no one is using sys.getdxp()?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Oct 4, 2022

Copy link
Copy Markdown
Member Author

Do we know for sure that no one is using sys.getdxp()?

I just searched in the PyPI top 5000 projects: I found 0 projects using getdxp(). I cannot be 100% sure. But if a project uses getdxp(), it can be updated to use the new way to gather stats, no? Also, we can add back the function if someone comes with a use case for it. For me, it's mostly a tool to develop and optimize Python. So if no Python core dev uses it, I don't think that we should worry about removing this function.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Oct 4, 2022

Copy link
Copy Markdown
Member Author

@smontanaro: I found a script using sys.getdxp() in "BitTorrent-master" . Are you still using it?

# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
(...)
def report(email, appname):
    """
    Send an RLE encoded version of sys.getdxp() off to our Top Men (tm)
    for analysis.
    """
    if hasattr(sys, 'getdxp') and appname:
        dxp = xmlrpclib.ServerProxy("http://manatee.mojam.com:7304")
        dxp.add_dx_info(appname, email, sys.version_info[:3], rle(sys.getdxp()))

See twisted/python/dxprofile.py for the full source with the rle() function.

This script was part of Twisted and was removed in Twisted Core 8.0.0 (2008-03-17) because it no longer worked (issue #2908).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Oct 4, 2022

Copy link
Copy Markdown
Member Author

I found references to getdxp() by @smontanaro on python-dev mailing list in 2001-2003:

  • Instruction count frequency server
  • Python optmizations
  • automated testing system
  • Dynamic bytecode analysis
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Oct 4, 2022

Copy link
Copy Markdown
Member Author

Ah by the way, as you can see in this PR, sys.getdxp() is not documented and not tested at all. There is just a test on the script.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@smontanaro

smontanaro commented Oct 4, 2022

Copy link
Copy Markdown
Contributor

@vstinner As you might have expected, I'm no longer using the dxp stuff, but thanks for checking. :-)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner
gh-97670: Remove sys.getdxp() and analyze_dxp.py script
7337383
Remove the sys.getdxp() function and the Tools/scripts/analyze_dxp.py
script. DXP stands for "dynamic execution pairs". They were related
to DYNAMIC_EXECUTION_PROFILE and DXPAIRS macros which have been
removed in Python 3.11. Python can now be built with "./configure
--enable-pystats" to gather statistics on Python opcodes.
@vstinner
vstinner merged commit 116fa62 into python:main Oct 4, 2022
@bedevere-bot bedevere-bot removed the awaiting core review label Oct 4, 2022
@vstinner
vstinner deleted the remove_dxp branch October 4, 2022 13:29
@vstinner

vstinner commented Oct 4, 2022

Copy link
Copy Markdown
Member Author

Thanks for reviews. It's now removed.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@markshannon markshannon Awaiting requested review from markshannon markshannon is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@vstinner @markshannon @smontanaro @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.