Title: [278732] trunk/Tools
- Revision
- 278732
- Author
- jbed...@apple.com
- Date
- 2021-06-10 14:11:09 -0700 (Thu, 10 Jun 2021)
Log Message
[webkitcorepy] 6x performance improvement in Memoized
https://bugs.webkit.org/show_bug.cgi?id=226891
<rdar://problem/79151940>
Reviewed by Stephanie Lewis.
* Scripts/libraries/webkitcorepy/setup.py: Bump version.
* Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py: Ditto.
* Scripts/libraries/webkitcorepy/webkitcorepy/decorators.py:
(Memoize.__call__.decorator): inspect.getargspec retrieves many bits of
information about the function we don't care about. Retrieve arguments manually
(and only do it once) to increase performance of Memoized function calls.
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (278731 => 278732)
--- trunk/Tools/ChangeLog 2021-06-10 21:03:00 UTC (rev 278731)
+++ trunk/Tools/ChangeLog 2021-06-10 21:11:09 UTC (rev 278732)
@@ -1,3 +1,18 @@
+2021-06-10 Jonathan Bedard <jbed...@apple.com>
+
+ [webkitcorepy] 6x performance improvement in Memoized
+ https://bugs.webkit.org/show_bug.cgi?id=226891
+ <rdar://problem/79151940>
+
+ Reviewed by Stephanie Lewis.
+
+ * Scripts/libraries/webkitcorepy/setup.py: Bump version.
+ * Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py: Ditto.
+ * Scripts/libraries/webkitcorepy/webkitcorepy/decorators.py:
+ (Memoize.__call__.decorator): inspect.getargspec retrieves many bits of
+ information about the function we don't care about. Retrieve arguments manually
+ (and only do it once) to increase performance of Memoized function calls.
+
2021-06-10 Philippe Normand <pnorm...@igalia.com>
[WPE] Enable Cog for developer builds
Modified: trunk/Tools/Scripts/libraries/webkitcorepy/setup.py (278731 => 278732)
--- trunk/Tools/Scripts/libraries/webkitcorepy/setup.py 2021-06-10 21:03:00 UTC (rev 278731)
+++ trunk/Tools/Scripts/libraries/webkitcorepy/setup.py 2021-06-10 21:11:09 UTC (rev 278732)
@@ -30,7 +30,7 @@
setup(
name='webkitcorepy',
- version='0.5.16',
+ version='0.5.17',
description='Library containing various Python support classes and functions.',
long_description=readme(),
classifiers=[
Modified: trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py (278731 => 278732)
--- trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py 2021-06-10 21:03:00 UTC (rev 278731)
+++ trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py 2021-06-10 21:11:09 UTC (rev 278732)
@@ -37,7 +37,7 @@
from webkitcorepy.task_pool import TaskPool
from webkitcorepy.credentials import credentials
-version = Version(0, 5, 16)
+version = Version(0, 5, 17)
from webkitcorepy.autoinstall import Package, AutoInstall
if sys.version_info > (3, 0):
Modified: trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/decorators.py (278731 => 278732)
--- trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/decorators.py 2021-06-10 21:03:00 UTC (rev 278731)
+++ trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/decorators.py 2021-06-10 21:11:09 UTC (rev 278732)
@@ -20,7 +20,6 @@
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-import inspect
import time
from collections import defaultdict
@@ -34,12 +33,14 @@
def __call__(self, function):
def decorator(*args, **kwargs):
+ fargs = function.__code__.co_varnames[:function.__code__.co_argcount]
+
timeout = self.timeout
- if 'timeout' not in inspect.getargspec(function).args:
+ if 'timeout' not in fargs:
timeout = kwargs.pop('timeout', timeout)
cached = self.cached
- if 'cached' not in inspect.getargspec(function).args:
+ if 'cached' not in fargs:
cached = kwargs.pop('cached', cached)
keyargs = args + tuple(sorted([(key, value) for key, value in kwargs.items()]))
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes