Skip to content

gh-93911: LOAD_ATTR_PROPERTY - #93912

Merged
Fidget-Spinner merged 14 commits into
python:mainfrom
Fidget-Spinner:load_attr_property
Jun 17, 2022
Merged

Fidget-Spinner merged 14 commits into
python:mainfrom
Fidget-Spinner:load_attr_property

Conversation

@Fidget-Spinner

@Fidget-Spinner Fidget-Spinner commented Jun 16, 2022 •

Copy link
Copy Markdown
Member

Linked to #93911.

@Fidget-Spinner Fidget-Spinner changed the title GH-93911: LOAD_ATTR_PROPERTY gh-93911: LOAD_ATTR_PROPERTY Jun 16, 2022

ghost left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a few minor nits.

Have you benchmarked this?

@@ -0,0 +1,26 @@
#ifndef Py_INTERNAL_DESCROBJECT_H

ghost Jun 17, 2022

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe "pycore_property.h" as it is just the property struct.

ghost Jun 17, 2022

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm leaving it generic from now (and naming it after the file it came from) so that I can re-use it again in the future when I add more specialisations. (E.g. classmethod is also from the same file)

ghost Jun 17, 2022

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do properties and classmethods really belong in the same file? Sure, they are both descriptors, but so are Python functions.
The file layout is a bit of an historical artifact.

ghost Jun 17, 2022

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you don't want to change it for this PR, that's fine too.

Comment thread Python/ceval.c Outdated
Comment thread Python/specialize.c
@bedevere-bot

ghost commented Jun 17, 2022

Copy link
Copy Markdown

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

@Fidget-Spinner

ghost commented Jun 17, 2022

Copy link
Copy Markdown
Member Author

Have you benchmarked this?

No, and I don't expect it to affect pypyerformance. None of the pyperformance benchmarks have property. It's only in the stats because pyperformance itself uses it. https://github.com/python/pyperformance/search?q=property

For real-world code, this should be a win, property is quite common.

@markshannon

ghost commented Jun 17, 2022

Copy link
Copy Markdown
Member

None of the pyperformance benchmarks have property.

Sounds like we need more benchmarks.

@Fidget-Spinner

ghost commented Jun 17, 2022 •

Copy link
Copy Markdown
Member Author

Thanks for the reviews Mark. I'm merging this so that it unblocks your work (I'm also working on other specializations that are waiting on this).

(Running a refleak full test run locally before merging).

@Fidget-Spinner

ghost commented Jun 17, 2022

Copy link
Copy Markdown
Member Author
== Tests result: SUCCESS ==

396 tests OK.

40 tests skipped:
    test_curses test_dbm_gnu test_dbm_ndbm test_devpoll test_epoll
    test_fcntl test_fork1 test_gdb test_grp test_ioctl test_kqueue
    test_multiprocessing_fork test_multiprocessing_forkserver test_nis
    test_openpty test_ossaudiodev test_pipes test_poll test_posix
    test_pty test_pwd test_readline test_resource test_smtpnet
    test_socketserver test_spwd test_syslog test_threadsignals
    test_tix test_tk test_ttk_guionly test_urllib2net test_urllibnet
    test_wait3 test_wait4 test_winsound test_xmlrpc_net test_xxlimited
    test_xxtestfuzz test_zipfile64

Total duration: 20 min 51 sec

@Fidget-Spinner
Fidget-Spinner merged commit a51742a into python:main Jun 17, 2022
@Fidget-Spinner
Fidget-Spinner deleted the load_attr_property branch June 17, 2022 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants