Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
738ca29f
Commit
738ca29f
authored
May 19, 2020
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix benchmark, and make AsyncResult use the provided API.
parent
1f8d34c4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
benchmarks/micro_semaphore.sh
benchmarks/micro_semaphore.sh
+3
-3
src/gevent/event.py
src/gevent/event.py
+1
-3
No files found.
benchmarks/micro_semaphore.sh
View file @
738ca29f
#!/bin/sh
set
-e
-x
PYTHON
=
${
PYTHON
:
=python
}
$PYTHON
-mperf
timeit
-s
'from gevent.lock import Semaphore; s = Semaphore()'
's.release()'
$PYTHON
-mperf
timeit
-s
'from gevent.lock import Semaphore; from gevent import spawn_raw; s = Semaphore(0)'
'spawn_raw(s.release); s.acquire()'
$PYTHON
-mperf
timeit
-s
'from gevent.lock import Semaphore; from gevent import spawn_raw; s = Semaphore(0)'
'spawn_raw(s.release); spawn_raw(s.release); spawn_raw(s.release); spawn_raw(s.release); s.acquire(); s.acquire(); s.acquire(); s.acquire()'
$PYTHON
-mp
yp
erf
timeit
-s
'from gevent.lock import Semaphore; s = Semaphore()'
's.release()'
$PYTHON
-mp
yp
erf
timeit
-s
'from gevent.lock import Semaphore; from gevent import spawn_raw; s = Semaphore(0)'
'spawn_raw(s.release); s.acquire()'
$PYTHON
-mp
yp
erf
timeit
-s
'from gevent.lock import Semaphore; from gevent import spawn_raw; s = Semaphore(0)'
'spawn_raw(s.release); spawn_raw(s.release); spawn_raw(s.release); spawn_raw(s.release); s.acquire(); s.acquire(); s.acquire(); s.acquire()'
src/gevent/event.py
View file @
738ca29f
...
...
@@ -7,7 +7,6 @@ from __future__ import print_function
from
gevent._util
import
_NONE
from
gevent._compat
import
reraise
from
gevent._tblib
import
dump_traceback
,
load_traceback
from
gevent._hub_local
import
get_hub_noargs
as
get_hub
from
gevent.timeout
import
Timeout
...
...
@@ -327,8 +326,7 @@ class AsyncResult(AbstractLinkable): # pylint:disable=undefined-variable
# Not ready and not blocking, so immediately timeout
raise
Timeout
()
if
self
.
hub
is
None
:
# pylint:disable=access-member-before-definition
self
.
hub
=
get_hub
()
# pylint:disable=attribute-defined-outside-init
self
.
_capture_hub
(
True
)
# Wait, raising a timeout that elapses
self
.
_wait_core
(
timeout
,
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment