Skip to content

Commit

Permalink
Try out perf with forkserver
Browse files Browse the repository at this point in the history
  • Loading branch information
sigurdp committed Oct 12, 2023
1 parent 4bf1501 commit 941d117
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,11 @@ async def calc_surf_isec_multiprocess(
intersections = []

# Experiment with switching to spawn
# Note that for multiprocess the default is fork
# Note that for multiprocess the default is fork, which is faster, but has issues with shutting down uvicorn
# See: https://superfastpython.com/multiprocessing-pool-context/
# Use None to get the default context
context = multiprocessing.get_context("spawn")
#context = multiprocessing.get_context("spawn")
context = multiprocessing.get_context("forkserver")

with context.Pool(
initializer=init_access_and_fence,
Expand Down

0 comments on commit 941d117

Please sign in to comment.