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
| # This benchmark is AI-generated | |
| """ | |
| Benchmark script comparing pure Python UUID implementation | |
| with C implementation. | |
| Tests: | |
| - uuid4() generation | |
| - uuid7() generation | |
| - UUID instantiation from string |
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 time | |
| WARMUP_RUNS = 5 | |
| BENCH_RUNS = 20 | |
| FACTOR = 200 | |
| num_tasks = 0 |
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
| { | |
| scene_max_dpr: 1, | |
| scene_max_samples: 3, | |
| scene_camera_fov: 55, | |
| scene_camera_rot: { x: 0, y: 0, z: 0 }, | |
| scene_camera_pos: { x: 0, y: 0, z: 5 }, | |
| bg_nspace: 7, | |
| bg_lines: 2, | |
| bg_line_size_vari: { min: 0.3, max: 0.8 }, | |
| bg_line_brightness: 87.04, |
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
| import pyrsistent | |
| import immutables | |
| import time | |
| I = 1000000 | |
| 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
| yury@ares ~/benchmarks $ uname -a | |
| Linux ares.sprymix.net 4.1.2 #10 SMP Fri Jul 10 19:14:52 EDT 2015 x86_64 Intel(R) Xeon(R) CPU E5-1620 v2 @ 3.70GHz GenuineIntel GNU/Linux | |
| yury@ares ~/benchmarks $ ../tmp/cpython/python -c 'import sys; print(sys.version)' | |
| 3.6.0a0 (default, Jan 26 2016, 19:04:11) | |
| [GCC 4.9.3] | |
| yury@ares ~/benchmarks $ cat /proc/meminfo | grep MemTotal | |
| MemTotal: 65948368 kB |
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()) |
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
| export LDFLAGS="-L/opt/local/lib/" | |
| export LD_LIBRARY_PATH="/opt/local/lib/" | |
| export CPPFLAGS="-I/opt/local/include -I/opt/local/include/openssl" | |
| ./configure | |
| make -j8 |
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
| const buf = Buffer.allocUnsafe(16); | |
| function f1(buf) { | |
| return ( | |
| buf.slice(0, 4).toString("hex") + | |
| "-" + | |
| buf.slice(4, 6).toString("hex") + | |
| "-" + | |
| buf.slice(6, 8).toString("hex") + | |
| "-" + |
NewerOlder