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
e71f7cf6
Commit
e71f7cf6
authored
Dec 16, 2013
by
Fantix King
Committed by
Denis Bilenko
Dec 16, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use xrange from gevent.hub
parent
47f1c3d5
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
23 additions
and
13 deletions
+23
-13
benchmarks/micro.sh
benchmarks/micro.sh
+1
-1
benchmarks/micro_greenlet_link.sh
benchmarks/micro_greenlet_link.sh
+6
-6
benchmarks/micro_run_callback.sh
benchmarks/micro_run_callback.sh
+4
-4
gevent/baseserver.py
gevent/baseserver.py
+1
-1
gevent/hub.py
gevent/hub.py
+2
-0
gevent/subprocess.py
gevent/subprocess.py
+1
-1
greentest/bench_sleep0.py
greentest/bench_sleep0.py
+4
-0
greentest/bench_spawn.py
greentest/bench_spawn.py
+4
-0
No files found.
benchmarks/micro.sh
View file @
e71f7cf6
...
...
@@ -11,7 +11,7 @@ python -mtimeit -r 6 -s'from gevent.coros import Semaphore; from gevent import s
python
-mtimeit
-r
6
-s
'from gevent import spawn; f = lambda : 5'
'spawn(f)'
python
-mtimeit
-r
6
-s
'from gevent import spawn; f = lambda : 5'
'spawn(f).join()'
python
-mtimeit
-r
6
-s
'from gevent import spawn, run; f = lambda : 5'
'for _ in xrange(10000): spawn(f)'
'run()'
python
-mtimeit
-r
6
-s
'from gevent import spawn, run; f
rom gevent.hub import xrange; f
= lambda : 5'
'for _ in xrange(10000): spawn(f)'
'run()'
python
-mtimeit
-r
6
-s
'from gevent import spawn_raw; f = lambda : 5'
'spawn_raw(f)'
python
-mtimeit
-r
6
-s
'from gevent import sleep; f = lambda : 5'
'sleep(0)'
...
...
benchmarks/micro_greenlet_link.sh
View file @
e71f7cf6
#!/bin/sh
set
-e
-x
python
-mtimeit
-r
6
-s
'from gevent import spawn; g = spawn(lambda: 5); l = lambda: 5'
'for _ in xrange(1000): g.link(l)'
python
-mtimeit
-r
6
-s
'from gevent import spawn; g = spawn(lambda: 5); l = lambda *args: 5'
'for _ in xrange(10): g.link(l);'
'g.join()'
python
-mtimeit
-r
6
-s
'from gevent import spawn; g = spawn(lambda: 5); l = lambda *args: 5'
'for _ in xrange(100): g.link(l);'
'g.join()'
python
-mtimeit
-r
6
-s
'from gevent import spawn; g = spawn(lambda: 5); l = lambda *args: 5'
'for _ in xrange(1000): g.link(l);'
'g.join()'
python
-mtimeit
-r
6
-s
'from gevent import spawn; g = spawn(lambda: 5); l = lambda *args: 5'
'for _ in xrange(10000): g.link(l);'
'g.join()'
python
-mtimeit
-r
6
-s
'from gevent import spawn; g = spawn(lambda: 5); l = lambda *args: 5'
'for _ in xrange(100000): g.link(l);'
'g.join()'
python
-mtimeit
-r
6
-s
'from gevent import spawn;
from gevent.hub import xrange;
g = spawn(lambda: 5); l = lambda: 5'
'for _ in xrange(1000): g.link(l)'
python
-mtimeit
-r
6
-s
'from gevent import spawn;
from gevent.hub import xrange;
g = spawn(lambda: 5); l = lambda *args: 5'
'for _ in xrange(10): g.link(l);'
'g.join()'
python
-mtimeit
-r
6
-s
'from gevent import spawn;
from gevent.hub import xrange;
g = spawn(lambda: 5); l = lambda *args: 5'
'for _ in xrange(100): g.link(l);'
'g.join()'
python
-mtimeit
-r
6
-s
'from gevent import spawn;
from gevent.hub import xrange;
g = spawn(lambda: 5); l = lambda *args: 5'
'for _ in xrange(1000): g.link(l);'
'g.join()'
python
-mtimeit
-r
6
-s
'from gevent import spawn;
from gevent.hub import xrange;
g = spawn(lambda: 5); l = lambda *args: 5'
'for _ in xrange(10000): g.link(l);'
'g.join()'
python
-mtimeit
-r
6
-s
'from gevent import spawn;
from gevent.hub import xrange;
g = spawn(lambda: 5); l = lambda *args: 5'
'for _ in xrange(100000): g.link(l);'
'g.join()'
benchmarks/micro_run_callback.sh
View file @
e71f7cf6
...
...
@@ -2,9 +2,9 @@
set
-e
-x
python
-mtimeit
-r
6
-s
'from gevent import run,get_hub; run_cb = get_hub().loop.run_callback; f = lambda : 5'
'run_cb(f)'
python
-mtimeit
-r
6
-s
'from gevent import run,get_hub; run_cb = get_hub().loop.run_callback; f = lambda : 5'
'run_cb(f)'
'run()'
python
-mtimeit
-r
6
-s
'from gevent import run,get_hub; run_cb = get_hub().loop.run_callback; f = lambda : 5'
'for _ in xrange(100): run_cb(f)'
python
-mtimeit
-r
6
-s
'from gevent import run,get_hub; run_cb = get_hub().loop.run_callback; f = lambda : 5'
'for _ in xrange(100): run_cb(f)'
'run()'
python
-mtimeit
-r
6
-s
'from gevent import run,get_hub; run_cb = get_hub().loop.run_callback; f = lambda : 5'
'for _ in xrange(10000): run_cb(f)'
python
-mtimeit
-r
6
-s
'from gevent import run,get_hub; run_cb = get_hub().loop.run_callback; f = lambda : 5'
'for _ in xrange(10000): run_cb(f)'
'run()'
python
-mtimeit
-r
6
-s
'from gevent import run,get_hub;
from gevent.hub import xrange;
run_cb = get_hub().loop.run_callback; f = lambda : 5'
'for _ in xrange(100): run_cb(f)'
python
-mtimeit
-r
6
-s
'from gevent import run,get_hub;
from gevent.hub import xrange;
run_cb = get_hub().loop.run_callback; f = lambda : 5'
'for _ in xrange(100): run_cb(f)'
'run()'
python
-mtimeit
-r
6
-s
'from gevent import run,get_hub;
from gevent.hub import xrange;
run_cb = get_hub().loop.run_callback; f = lambda : 5'
'for _ in xrange(10000): run_cb(f)'
python
-mtimeit
-r
6
-s
'from gevent import run,get_hub;
from gevent.hub import xrange;
run_cb = get_hub().loop.run_callback; f = lambda : 5'
'for _ in xrange(10000): run_cb(f)'
'run()'
gevent/baseserver.py
View file @
e71f7cf6
...
...
@@ -5,7 +5,7 @@ import _socket
import
errno
from
gevent.greenlet
import
Greenlet
,
getfuncname
from
gevent.event
import
Event
from
gevent.hub
import
string_types
,
integer_types
,
get_hub
from
gevent.hub
import
string_types
,
integer_types
,
get_hub
,
xrange
__all__
=
[
'BaseServer'
]
...
...
gevent/hub.py
View file @
e71f7cf6
...
...
@@ -33,9 +33,11 @@ PY3 = sys.version_info[0] >= 3
if
PY3
:
string_types
=
str
,
integer_types
=
int
,
xrange
=
range
else
:
string_types
=
basestring
,
integer_types
=
(
int
,
long
)
xrange
=
xrange
if
sys
.
version_info
[
0
]
<=
2
:
...
...
gevent/subprocess.py
View file @
e71f7cf6
...
...
@@ -6,7 +6,7 @@ import gc
import
signal
import
traceback
from
gevent.event
import
AsyncResult
from
gevent.hub
import
get_hub
,
linkproxy
,
sleep
,
getcurrent
,
integer_types
,
string_types
from
gevent.hub
import
get_hub
,
linkproxy
,
sleep
,
getcurrent
,
integer_types
,
string_types
,
xrange
from
gevent.fileobject
import
FileObject
from
gevent.greenlet
import
Greenlet
,
joinall
spawn
=
Greenlet
.
spawn
...
...
greentest/bench_sleep0.py
View file @
e71f7cf6
"""Benchmarking sleep(0) performance."""
import
sys
from
time
import
time
try
:
xrange
except
NameError
:
xrange
=
range
def
noop
(
p
):
...
...
greentest/bench_spawn.py
View file @
e71f7cf6
...
...
@@ -4,6 +4,10 @@ import sys
import
os
import
random
from
time
import
time
try
:
xrange
except
NameError
:
xrange
=
range
N
=
10000
...
...
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