Skip to content

Commit befb545

Browse files
author
Pan
committed
Bypass python object __init__ when initialising cython extention classes for speedup.
1 parent cfa5b14 commit befb545

File tree

16 files changed

+484
-392
lines changed

16 files changed

+484
-392
lines changed

ssh2/agent.c

Lines changed: 23 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ssh2/agent.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ cdef void clear_agent(c_ssh2.LIBSSH2_AGENT *agent) nogil:
9191

9292

9393
cdef object PyAgent(c_ssh2.LIBSSH2_AGENT *agent, Session session):
94-
cdef Agent _agent = Agent(session)
94+
cdef Agent _agent = Agent.__new__(Agent, session)
9595
_agent._agent = agent
9696
return _agent
9797

ssh2/channel.c

Lines changed: 46 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ssh2/channel.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ cimport error_codes
2525

2626

2727
cdef object PyChannel(c_ssh2.LIBSSH2_CHANNEL *channel, Session session):
28-
cdef Channel _channel = Channel(session)
28+
cdef Channel _channel = Channel.__new__(Channel, session)
2929
_channel._channel = channel
3030
return _channel
3131

0 commit comments

Comments
 (0)