$ git clone https://github.com/MagicStack/immutables.gitcd immutableswget https://gist.githubusercontent.com/1st1/57d979e1e58948a7e523754a3d02a57d/raw/8857aca8e0f13c804218540820993b6481cd6619/bench.pypypy3 bench.py-- observe the timings for "hamt"- run
pypy3 bench.py-- observe how "hamt" timings are way worse now
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/Lib/test/bad_getattr.py b/Lib/test/bad_getattr.py | |
| new file mode 100644 | |
| index 0000000000..b4f790f3bf | |
| --- /dev/null | |
| +++ b/Lib/test/bad_getattr.py | |
| @@ -0,0 +1,3 @@ | |
| +x = 1 | |
| + | |
| +__getattr__ = "Surprise!" | |
| diff --git a/Lib/test/bad_getattr2.py b/Lib/test/bad_getattr2.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| import random | |
| import time | |
| async def worker(name, queue): | |
| while True: | |
| # Get a "work item" out of the queue. | |
| sleep_for = await queue.get() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| from twisted.internet import asyncioreactor | |
| asyncioreactor.install() | |
| import treq | |
| from twisted.internet.defer import Deferred, ensureDeferred | |
| from twisted.internet.task import react | |
| async def run(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # in asyncio: | |
| class asyncio.AbstractFileIOImplementation: | |
| async def open(self): | |
| raise NotImplementedError | |
| async def open(...): | |
| return await get_current_loop(). get_file_io_implementation().open(...) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pyrsistent | |
| import immutables | |
| import time | |
| I = 1_000_000 | |
| KEY = '5' | |
| for N in [5, 10, 20, 30, 100, 200, 300, 400, 500, 1000]: | |
| print('=============') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/configure b/configure | |
| index 6ce0728af1..f82db5b684 100755 | |
| --- a/configure | |
| +++ b/configure | |
| @@ -16794,7 +16794,7 @@ fi | |
| # no such luck; use some default ssldirs | |
| if ! $found; then | |
| - ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr" | |
| + ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /opt/local /usr" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ====================================================================== | |
| # Calculating pi, 10000 iterations | |
| # ====================================================================== | |
| Precision: 9 decimal digits | |
| float: | |
| result: 3.1415926535897927 | |
| time: 0.056572s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from functools import singledispatch | |
| @singledispatch | |
| def repr_png(arg): | |
| if hasattr(type(arg), '__repr_png__'): | |
| return type(arg).__repr_png__(arg) | |
| raise | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import struct | |
| try: | |
| from time import perf_counter as clock | |
| except ImportError: | |
| from time import time as clock | |
| import asyncio | |
| import uvloop | |
| asyncio.set_event_loop_policy(uvloop.EventLoopPolicy()) |