Jimmy Lai added the comment:
Just found Guido mentioned LibCST. Here is a quick overview:
1. LibCST is an open source Python concrete syntax tree parser. It provides a
CST looks like and feel like AST.
2. It's built by Instagram for linter and refactoring tools (exact use cases
what Ł
Changes by Jimmy Lai :
--
pull_requests: +3329
___
Python tracker
<http://bugs.python.org/issue30423>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Jimmy Lai:
get_event_loop() and _get_running_loop() can be faster.
CaseTimeMeanImprove
No
Changes by Jimmy Lai :
--
type: -> performance
___
Python tracker
<http://bugs.python.org/issue31350>
___
___
Python-bugs-list mailing list
Unsubscrib
Jimmy Lai added the comment:
Benchmark script: Run 10 times to get mean and stdev
import asyncio
import time
async def async_get_loop():
start_time = time.time()
for _ in range(500):
asyncio.get_event_loop()
return time.time() - start_time
loop
Changes by Jimmy Lai :
--
pull_requests: +1794
___
Python tracker
<http://bugs.python.org/issue26171>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Jimmy Lai:
Problem:
"RuntimeError: Event loop stopped before Future completed." throws when calling
run_until_complete().
We investigate and find out some orphan futures stay in the event loop before
we run another run_until_complete(another_async_func()).
New submission from Jimmy Lai :
`ensure_future` converts the input as future if it's not already a future.
The condition is the following:
if futures.isfuture(coro_or_future):
...
elif coroutines.iscoroutine(coro_or_future):
...
elif inspect.isawaitable(coro_or_future):
...
In
Change by Jimmy Lai :
--
keywords: +patch
pull_requests: +6515
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue33505>
___
___
Python-
Change by Jimmy Lai :
--
pull_requests: +6518
___
Python tracker
<https://bugs.python.org/issue33505>
___
___
Python-bugs-list mailing list
Unsubscribe:
Jimmy Lai added the comment:
Benchmark result:
./python.exe -m perf compare_to ensure_future_original.json
ensure_future_optimized.json
Mean +- std dev: [ensure_future_original] 57.4 ms +- 4.0 ms ->
[ensure_future_optimized] 49.3 ms +- 4.5 ms: 1.17x faster (-14%)
--
Added file: ht
New submission from Jimmy Lai :
asyncio.isfuture called whenever ensure_future is called. Providing C
implementation to make it fast.
--
components: asyncio
messages: 316670
nosy: asvetlov, jimmylai, yselivanov
priority: normal
severity: normal
status: open
title: Optimize
Jimmy Lai added the comment:
$./python.exe isfuture_benchmark.py -o isfuture_optimized.json
$ ./python.exe -m perf compare_to isfuture_original.json isfuture_optimized.json
Mean +- std dev: [isfuture_original] 7.16 ms +- 0.23 ms -> [isfuture_optimized]
5.41 ms +- 0.25 ms: 1.32x faster (
Change by Jimmy Lai :
--
keywords: +patch
pull_requests: +6552
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue33521>
___
___
Python-
Jimmy Lai added the comment:
@vstinner Thanks for the new benchmark, it provides more detailed wins:
It's 1.64x faster for future object and 1.23x faster for non-future object.
$ ./python.exe -m perf compare_to isfuture_original_2.json
isfuture_optimized_2.json
future: Mean +- st
Jimmy Lai added the comment:
@pitrou This change is part of optimization for asyncio.gather().
gather -> ensure_future -> isfuture/iscoroutine/isawaitable
We need C implementation for all those function to make gather really efficient
for large scale application (e.g. Instagram)
Gat
Jimmy Lai added the comment:
@pitrou We'll measure the wins of gather when we implement it in C. Before
that, we need to get all helpers ready in C.
--
___
Python tracker
<https://bugs.python.org/is
Jimmy Lai added the comment:
@vstinner
In general, we would like to make all asyncio common functions efficient with C
implementation because CPython asyncio overhead is very expensive.
In our application, overall it costs about 10% global CPU instructions after we
used UVLoop (it's
18 matches
Mail list logo