-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Getting "performance hint: ..." #6001
Comments
I can't reproduce with the code given here. To make it compile I slightly modified it to the below:
I get no performance warnings, which I believe is correct. |
@da-woods I had the same code before(tried all the combination). When you first compile the code you get the It kept tripping me as well... p.s. you can see actual code at: https://github.com/YoSTEALTH/Liburing/tree/master/src/liburing |
@da-woods have you tried the code after deleting |
Sorry you're right. There is a That looks to be by design and that we don't assume the cython/Cython/Compiler/Nodes.py Line 729 in 03d982b
I think unfortunately that is correct, and that you can compile something with:
so if you just see the pxd file you can't reason about the error code. That suggests we need to improve the performance hint to tell you that since I don't think we can change the behaviour easily. It might also we worth warning about "exception value in pyx but not in pxd" but I'm not sure about that. |
That didn't work, was still getting the same message. So, I tried random stuff and this seem to work: # error.pxd
cpdef int trap_error(int no) except -1 nogil # error.pyx
cpdef inline int trap_error(int no) except -1 nogil: Don't even know whats going on! But happy the message is gone :) |
Your solution is right. The code I posted was an explanation, not something you should do |
@da-woods Cool, Thank your very much for your amazing support. |
I'm going to reopen this because I think we could improve the text of the performance hints here. |
In order to be called efficiently, these functions must have the exception specification set in the pxd file since Cython is unable to assume an implicit exception specification. This improves the quality of the messages to draw attention to this detail. Closes cython#6001
In order to be called efficiently, these functions must have the exception specification set in the pxd file since Cython is unable to assume an implicit exception specification. This improves the quality of the messages to draw attention to this detail. Closes #6001
In order to be called efficiently, these functions must have the exception specification set in the pxd file since Cython is unable to assume an implicit exception specification. This improves the quality of the messages to draw attention to this detail. Closes #6001
@da-woods For io_uring_enter since trap_error is being used, also by other functions, getting lots of these messages: performance hint: src/liburing/syscall.pxd:7:24: No exception value declared for 'io_uring_enter' in pxd file.
Users cimporting this function and calling it without the gil will always require an exception check.
Suggest adding an explicit exception value. tested with |
Describe the bug
I keep getting these "performance hint" bellow.
Goal is to run
io_uring_queue_init
withnogil
, since nogil required other functions to be nogil as well I have settrap_error
to benogil
as well and only trigger error when return value is< 0
, whywith gil:
block is used.I don't want to use
noexcept
fortrap_error
since half the function does need to trigger error.Code to reproduce the behaviour:
Expected behaviour
No response
OS
Linux
Python version
3.12
Cython version
3.0.8
Additional context
No response
The text was updated successfully, but these errors were encountered: