Skip to content

Instantly share code, notes, and snippets.

View lytex's full-sized avatar
🐍
Python

lytex

🐍
Python
View GitHub Profile
@lytex
lytex / ray_benchmarking.py
Created April 3, 2020 18:58
Rough benchmarking to estimate overhead of spawning a process vs time of execution
import ray
from time import sleep, time
import numpy as np
import pandas as pd
thread_number = 100
pids = list(range(thread_number))
min_wait = 0
max_wait = 100
@lytex
lytex / run_logging.py
Last active April 3, 2020 05:15
Log the current state of a long running program with custom format
import logging
from uuid import uuid4
import numpy as np
from time import sleep
LEVEL = 'DEBUG'
FILENAME = '123.log'
FILEMODE = 'a'
FORMAT = '%(asctime)s.%(msecs)03d %(levelname)s:%(name)s:%(message)s'