Skip to content

Commit

Permalink
Use USE_FAST_LOCALS envvar instead of USE_PURE_LOCALS, so optimizatio…
Browse files Browse the repository at this point in the history
…n must be enabled manually
  • Loading branch information
ask committed Sep 12, 2012
1 parent d753cd9 commit febda4c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
4 changes: 0 additions & 4 deletions celery/concurrency/threads.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@

from .base import apply_target, BasePool

#: Makes sure we don't use threading.local for stacks
#: since apparently they don't work properly.
os.environ['USE_PURE_LOCALS'] = '1'


class NullDict(UserDict):

Expand Down
6 changes: 2 additions & 4 deletions celery/utils/threads.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@
import threading
import traceback

from kombu.syn import _detect_environment

from celery.local import Proxy
from celery.utils.compat import THREAD_TIMEOUT_MAX

USE_PURE_LOCALS = os.environ.get('USE_PURE_LOCALS')
USE_FAST_LOCALS = os.environ.get('USE_FAST_LOCALS')

_Thread = threading.Thread
_Event = threading._Event
Expand Down Expand Up @@ -319,7 +317,7 @@ def top(self):
except (AttributeError, IndexError):
return None

if _detect_environment() == 'default' and not USE_PURE_LOCALS:
if USE_FAST_LOCALS:
LocalStack = _FastLocalStack
else:
# - See #706
Expand Down
5 changes: 4 additions & 1 deletion funtests/benchmarks/bench_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
import sys
import time

os.environ['NOSETPS'] = 'yes'
os.environ.update(
NOSETPS='yes',
USE_FAST_LOCALS='yes',
)

import anyjson
JSONIMP = os.environ.get('JSONIMP')
Expand Down

0 comments on commit febda4c

Please sign in to comment.