Comments (2)
Thank you for reporting this, I'll take a look. My initial suspicion is that we have some naive code that asserts the type of the self
argument - which is probably unnecessary given we know it's a class/instance method.
from ziggy-pydust.
Yup, so a trace confirmed all the time is spent doing an import then isinstance check on the self parameter.
![Screenshot 2023-10-28 at 22 37 43](https://private-user-images.githubusercontent.com/1928052/278838938-e2decafe-2d93-4652-9487-4dcb927feb8f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg4NzY5NzcsIm5iZiI6MTcxODg3NjY3NywicGF0aCI6Ii8xOTI4MDUyLzI3ODgzODkzOC1lMmRlY2FmZS0yZDkzLTQ2NTItOTQ4Ny00ZGNiOTI3ZmViOGYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYyMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MjBUMDk0NDM3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZDY1YTZjMTBkNTA3NGI4NWY0N2VlNzgzNzZhMWYwMzExNzM0ZWYyNjZjNWU0NjJhMGIwYzZiYWNlYTkxZWM3YSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.0hXu1ppzZ6-M20bYbJ6SUtNIqWpNTYqp1uZnMUBMniA)
I've put up a PR #228 that seems to fix it. With optimize=Debug:
(ziggy-pydust-py3.11) ➜ ziggy-pydust git:(ngates/class-method-perf) ✗ python -m timeit -s 'from example.fib import get1' 'get1()'
5000000 loops, best of 5: 85.2 nsec per loop
(ziggy-pydust-py3.11) ➜ ziggy-pydust git:(ngates/class-method-perf) ✗ python -m timeit -s 'from example.fib import Class; s = Class(10)' 's.get()'
5000000 loops, best of 5: 95.5 nsec per loop
I'll try to put up a proper fix to this (which I believe to be #227) tomorrow sometime.
from ziggy-pydust.
Related Issues (20)
- buildzig.py's sysconfig.get_config_var("LDLIBRARY") fails on Windows HOT 5
- Support GIL management
- Support Python base classes
- py.isinstance should support Pydust types
- Support __del__ method on modules (with m_free slot)
- Support *args and **kwargs
- Support tracebacks for non PyExc exceptions
- Convention for returning new/borrowed references
- Add py.alloc HOT 1
- Action Required: Fix Renovate Configuration
- Should produce error when non kwargs args follow variadic args HOT 1
- Provide fast conversion from `PyObject` to Pydust type struct
- Store PyType objects on module state
- GC traverse and clear should traverse plain structs
- Is pydust still in active development? HOT 2
- Support creating PyLong from arbitrary sized integers
- Using Pydust to Embed a Python Interpreter
- sysconfig.get_config_var("LDLIBRARY") is now defined in Windows Python v3.13.0b1
- License template is not populated.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ziggy-pydust.