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 __future__ import absolute_import | |
import sys | |
import threading | |
import collections | |
class WorkerPool(object): | |
"""A thread pool that processes items from an unbounded work queue, for | |
simple multi-producer, multi-consumer processes. |
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
@echo off | |
rem = """ | |
rem This is a hybrid batch and Python script. The batch (right here) invokes | |
rem the Python script and treats its standard output as a list of environment | |
rem variables to set in the current environment. | |
rem The -x argument causes the Python interpreter to ignore the first line. | |
rem The -S argument disables the implicit 'site' package import (speed go fast). | |
FOR /F "tokens=1,2 delims==" %%v IN ('python -x -S "%~f0" %*') DO SET %%v=%%w | |
GOTO :eof | |
""" |
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
#include <xmmintrin.h> | |
#include <stdint.h> | |
struct ResourceTable8 | |
{ | |
uint64_t type_bits_; | |
uintptr_t elements_[8]; | |
inline uint64_t mask_for_type(uint8_t type) | |
{ |
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
#include <string.h> | |
#if defined(__has_attribute) | |
#if __has_attribute(always_inline) | |
#define ALWAYS_INLINE __attribute__((always_inline)) | |
#endif | |
#endif | |
#if defined(_MSC_VER) | |
// To reduce debug build overhead: |
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
// Abseil absl::flat_hash_map | |
// Analysis of the critical path for perfectly predicted load hit. | |
// https://godbolt.org/z/P_ksaa | |
// | |
// x86_64 | |
// Instruction latencies have been entirely ignored. | |
# rdi = desired key | |
mov rax, qword ptr [rip + kHashSeed] # [a00] rax = per-process seed (with entropy) | |
add rax, rdi # [a01] rax = hash so far |
OlderNewer