[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scratch/elisp-benchmarks 69a99de283a 20/54: Add new 'inclist-type-hints'
From: |
Pip Cet |
Subject: |
scratch/elisp-benchmarks 69a99de283a 20/54: Add new 'inclist-type-hints' benchmark + tag new version |
Date: |
Mon, 30 Dec 2024 22:40:41 -0500 (EST) |
branch: scratch/elisp-benchmarks
commit 69a99de283a8faad96c5aa768a1aa922fa372dec
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>
Add new 'inclist-type-hints' benchmark + tag new version
* elisp-benchmarks.el: Tag new version.
* benchmarks/inclist-type-hints.el: New benchmark, same as
inclist.el but making use of compiler type hints.
---
elisp-benchmarks/benchmarks/inclist-type-hints.el | 44 +++++++++++++++++++++++
elisp-benchmarks/elisp-benchmarks.el | 2 +-
2 files changed, 45 insertions(+), 1 deletion(-)
diff --git a/elisp-benchmarks/benchmarks/inclist-type-hints.el
b/elisp-benchmarks/benchmarks/inclist-type-hints.el
new file mode 100644
index 00000000000..660f4e44ecf
--- /dev/null
+++ b/elisp-benchmarks/benchmarks/inclist-type-hints.el
@@ -0,0 +1,44 @@
+;;; bench/inclist-type-hints.el --- Exercise type hints -*- lexical-binding:
t; -*-
+
+;; Copyright (C) 2020 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Iteratively increment the elements of a list. Same as inclist.el
+;; but make use of compiler type hints.
+
+;;; Code:
+
+(require 'cl-lib)
+
+(defvar elb-inclist-th-no-type-hints-len 50000)
+(defvar elb-inclist-th-no-type-hints-list
+ (mapcar #'random (make-list elb-inclist-th-no-type-hints-len 100)))
+
+(defun elb-inclist-th (l)
+ (declare (cl-optimize (speed 3) (safety 0)))
+ (prog1 l
+ (while l
+ (let ((c (cl-the cons l)))
+ (cl-incf (cl-the fixnum (car c)))
+ (setq l (cdr c))))))
+
+(defun elb-inclist-type-hints-entry ()
+ (let ((l (copy-sequence elb-inclist-th-no-type-hints-list)))
+ (cl-loop repeat 10000
+ do (elb-inclist-th l))))
diff --git a/elisp-benchmarks/elisp-benchmarks.el
b/elisp-benchmarks/elisp-benchmarks.el
index 4ae4eca849c..326ff732ee5 100644
--- a/elisp-benchmarks/elisp-benchmarks.el
+++ b/elisp-benchmarks/elisp-benchmarks.el
@@ -4,7 +4,7 @@
;; Author: Andrea Corallo <akrl@sdf.org>
;; Maintainer: Andrea Corallo <akrl@sdf.org>
-;; Version: 1.7
+;; Version: 1.8
;; Keywords: languages, lisp
;; Package-Type: multi
;; Created: 2019-01-12
- branch scratch/elisp-benchmarks created (now b4b10726cda), Pip Cet, 2024/12/30
- scratch/elisp-benchmarks 28e2d369c9e 04/54: Reduce test setup + increase `elb-listlen-tc-len' lenght, Pip Cet, 2024/12/30
- scratch/elisp-benchmarks e0762e1f175 11/54: * elisp-benchmarks.el (elisp-benchmarks-run): Recompile by default., Pip Cet, 2024/12/30
- scratch/elisp-benchmarks b64855f83f0 03/54: * elisp-benchmarks.el: Fix Author/maintainer info, Pip Cet, 2024/12/30
- scratch/elisp-benchmarks 7b0d2d4f16e 06/54: Increment version number, Pip Cet, 2024/12/30
- scratch/elisp-benchmarks 7d2b7516a29 08/54: * benchmarks/dhrystone.el: New benchmark, Pip Cet, 2024/12/30
- scratch/elisp-benchmarks 2981efb7b57 07/54: * benchmarks/nbody.el: New benchmark, Pip Cet, 2024/12/30
- scratch/elisp-benchmarks 350b95f6082 10/54: * elisp-benchmarks.el: Typo fix, Pip Cet, 2024/12/30
- scratch/elisp-benchmarks d0963279fec 16/54: * benchmarks/map-closure.el: Add new u-benchmark., Pip Cet, 2024/12/30
- scratch/elisp-benchmarks 69a99de283a 20/54: Add new 'inclist-type-hints' benchmark + tag new version,
Pip Cet <=
- scratch/elisp-benchmarks a29db7b9366 18/54: * Update for new native-comp API + tag new version, Pip Cet, 2024/12/30
- scratch/elisp-benchmarks 7b4f68f6866 17/54: ; * elisp-benchmarks.el: Tag new version and update copyright., Pip Cet, 2024/12/30
- scratch/elisp-benchmarks c5680501af1 24/54: Allow for GC to kick in pidigit, Pip Cet, 2024/12/30
- scratch/elisp-benchmarks dd2ba559d66 27/54: * elisp-benchmarks.el (elb-runs): Fix group., Pip Cet, 2024/12/30
- scratch/elisp-benchmarks e372bd14f52 38/54: Make it usable on Emacs-27, Pip Cet, 2024/12/30
- scratch/elisp-benchmarks eb485e9acf3 25/54: Revert "Make `comp-speed' explicit in each benchmark", Pip Cet, 2024/12/30
- scratch/elisp-benchmarks c9be2a398f5 14/54: * elisp-benchmarks.el (elisp-benchmarks-run): Minor, better regexp., Pip Cet, 2024/12/30
- scratch/elisp-benchmarks bec6f1ea802 13/54: * benchmarks/flet.el: Add new u-benchmark., Pip Cet, 2024/12/30
- scratch/elisp-benchmarks 99b6355dd4b 01/54: New package initial add, Pip Cet, 2024/12/30
- scratch/elisp-benchmarks 68a4f973d26 15/54: * benchmarks/pcase.el: Add new u-benchmark., Pip Cet, 2024/12/30