Skip to content
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

Update corecext.ppyx #1077

Merged
merged 24 commits into from
Jan 23, 2018
Merged

Update corecext.ppyx #1077

merged 24 commits into from
Jan 23, 2018

Conversation

jamadden
Copy link
Member

  • Eliminate the use of the CPP. This is a prerequisite to Require cython when installing from a PyPI sdist? #1076. It also revealed a number of bugs in cythonpp.py, so we're much better off. This cuts 45s off the build process.
  • Watcher objects are slightly larger (two pointers), but additional optimizations made during the process are producing small but consistent performance gains on the test suite and the benchmarks.

Move to the safer __cinit__ for all watchers.

Now that the base watcher has access to its libev ev_watcher pointer, start moving the properties there, starting with ref.
cython ignores the preprocessor directives we previously had in
libev.pxd, so that was doing nothing, and it was treating vfd_socket_t
just as something it had to turn into an int.

The function it used to do this was the same function it used to turn
a generic PyObject into an int, once all the typedefs were substituted
in (which does use the c preprocessor from libev_vfd.h). So it should
be functionally equivalent.

The vfd_* functions are no-op macros on POSIX, so there shouldn't be a
performance difference. The minor exception is that __dealloc__ is
always defined, and although it's a static function suitable to
inline, there is an extra Python API call to PyErr_Fetch and
PyErr_Restore. But if that makes a difference, I didn't spot it.
…n windows, and forbid them from being created. This gets us down to only one CPP def, LIBEV_EMBED
This eliminates the need to call cythonpp.py on it. It also leads to a
more consistent API.

We could take the same approach to bring back sig_fd if necessary, but
that's still not available to cython.
@jamadden jamadden added this to the 1.3a1 milestone Jan 23, 2018
@jamadden jamadden merged commit 63c9318 into master Jan 23, 2018
@jamadden jamadden deleted the reduce-use-of-cpp-in-corecext branch January 23, 2018 20:54
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.

1 participant