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

Conversation

Projects
None yet
1 participant
@jamadden
Member

jamadden commented Jan 23, 2018

  • Eliminate the use of the CPP. This is a prerequisite to #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.

jamadden added some commits Jan 22, 2018

Start breaking apart the WATCHER macro to share code.
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.
Use vfd_socket_t on all platforms.
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.
We should be able to use dummy functions to link the child watchers o…
…n windows, and forbid them from being created. This gets us down to only one CPP def, LIBEV_EMBED
Attempt to workaround Visual C 9.0 for CPython 2.7 on windows missing…
… stdint.h. Also correct a compiler warning.
Stop using #ifdef LIBEV_EMBED in corecext.ppyx
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

5 checks passed

continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 75.189%
Details

@jamadden jamadden deleted the reduce-use-of-cpp-in-corecext branch Jan 23, 2018

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