[pypy-commit] pypy default: allow inlining into more of the thread library, specifically for get_ident, which used to be rendered as a call_may_force, and is now properly elided. Seems to be worth about 5% on the sqlite benchmark.

alex_gaynor noreply at buildbot.pypy.org
Fri Sep 2 23:38:07 CEST 2011


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: 
Changeset: r47032:68fbc674a800
Date: 2011-09-02 17:37 -0400
http://bitbucket.org/pypy/pypy/changeset/68fbc674a800/

Log:	allow inlining into more of the thread library, specifically for
	get_ident, which used to be rendered as a call_may_force, and is now
	properly elided. Seems to be worth about 5% on the sqlite
	benchmark.

diff --git a/pypy/module/pypyjit/policy.py b/pypy/module/pypyjit/policy.py
--- a/pypy/module/pypyjit/policy.py
+++ b/pypy/module/pypyjit/policy.py
@@ -8,7 +8,8 @@
                 modname == '__builtin__.interp_classobj' or
                 modname == '__builtin__.functional' or
                 modname == '__builtin__.descriptor' or
-                modname == 'thread.os_local'):
+                modname == 'thread.os_local' or
+                modname == 'thread.os_thread'):
             return True
         if '.' in modname:
             modname, _ = modname.split('.', 1)
diff --git a/pypy/module/pypyjit/test/test_policy.py b/pypy/module/pypyjit/test/test_policy.py
--- a/pypy/module/pypyjit/test/test_policy.py
+++ b/pypy/module/pypyjit/test/test_policy.py
@@ -34,7 +34,9 @@
 
 def test_thread_local():
     from pypy.module.thread.os_local import Local
+    from pypy.module.thread.os_thread import get_ident
     assert pypypolicy.look_inside_function(Local.getdict.im_func)
+    assert pypypolicy.look_inside_function(get_ident)
 
 def test_pypy_module():
     from pypy.module._collections.interp_deque import W_Deque


More information about the pypy-commit mailing list