From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Markers in a gap array Date: Thu, 04 Jul 2024 16:42:41 -0400 Message-ID: References: <87ikxlqwu6.fsf@localhost> <87le2hp6ug.fsf@localhost> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2071"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Ihor Radchenko , emacs-devel@gnu.org To: Pip Cet Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jul 04 22:43:41 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sPTIr-0000O3-02 for ged-emacs-devel@m.gmane-mx.org; Thu, 04 Jul 2024 22:43:41 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPTI4-0002vA-59; Thu, 04 Jul 2024 16:42:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPTI2-0002tI-2e for emacs-devel@gnu.org; Thu, 04 Jul 2024 16:42:50 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPTHz-00067F-4U for emacs-devel@gnu.org; Thu, 04 Jul 2024 16:42:48 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 50E7080974; Thu, 4 Jul 2024 16:42:43 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1720125761; bh=O6REELNoSjSlyCsDdSIkQPrJM6VSjwU6h9d1nn+rdOI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=afjx7NbaKvDoZpL18lNI1qBOffNEzsHwEfkANG1Q6WGUrL7NGPVPnCFR4i/PkebE6 EV1mUJpSElkueKJmM13pxXQuVyf5WVviVyE6EsNgMUGJ0OlOM7FkEn6Hk7WyvekeR5 KsyWoa2xPAlQ8D+JYjgBXpx1AxgJV0Xw2CKSlrvG7AZxc3f3737UzAhhqRUC4U2zzC 3/XkqTmI1aasjBwCgqY80kIBHCJTtF+hughnAQGrLWlaaoJZ7e1UqEbbCS+ebQXDFM BAZtb1vbJz2KQr1ObjKHOworg2Q2uPnK8mrgJlUCcwouYHn8VrDPEmli54wS5zxCSp gxFngOaFRFXvQ== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id BAB518036C; Thu, 4 Jul 2024 16:42:41 -0400 (EDT) Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id A1AF1120909; Thu, 4 Jul 2024 16:42:41 -0400 (EDT) In-Reply-To: (Pip Cet's message of "Thu, 04 Jul 2024 20:34:00 +0000") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:321360 Archived-At: --=-=-= Content-Type: text/plain > Could you share a more complete recipe for the benchmark? I wonder how it > compares to Gerd's weak vector/freelist in scratch/igc. Put it into the `benchmark` subdir of `elisp-benchmarks` and then do emacs --batch -Q -l .../elisp-benchmarks/elisp-benchmarks-autoloads.el \ --eval '(elisp-benchmarks-run "bytechar")' - Stefan --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=elb-bytechar.el Content-Transfer-Encoding: quoted-printable ;;; -*- lexical-binding: t -*- (defconst elb-bytechar-buffer (let ((buf (get-buffer-create " *elb-bytechar*"))) (with-current-buffer buf (let ((step (apply #'concat "=F0=9F=99=82 foo\n" (make-list 2000 "asd= f ")))) (dotimes (_ (/ 10000000 (length step))) (insert step)) buf)))) (defconst elb-bytechar-re "\\<.\\> \\<.\\> bar") (defun elb-bytechar--aux (nmarkers lookup &optional marker-fun) (with-current-buffer elb-bytechar-buffer (let ((step (/ (buffer-size) nmarkers)) (markers nil)) (dotimes (i nmarkers) (push (copy-marker (funcall (or marker-fun #'identity) (* i step))) markers)) (dotimes (_ 10) (goto-char (point-min)) (let ((parse-sexp-lookup-properties lookup)) (re-search-forward elb-bytechar-re nil t)))))) (defun elb-bytechar-100k-nolookup-entry () (elb-bytechar--aux 100000 nil)) (defun elb-bytechar-nolookup-entry () (elb-bytechar--aux 1 nil)) (defun elb-bytechar-entry () (elb-bytechar--aux 1 t)) (defun elb-bytechar-100k-entry () (elb-bytechar--aux 100000 t)) (defun elb-bytechar-100k-rev-entry () (elb-bytechar--aux 100000 t (lambda (pos) (- (point-max) pos)))) (defun elb-bytechar-100k-random-entry () (elb-bytechar--aux 100000 t (lambda (_) (random (buffer-size))))) (defun elb-bytechar-10k-random-entry () (elb-bytechar--aux 10000 t (lambda (_) (random (buffer-size))))) (defun elb-bytechar-1k-random-entry () (elb-bytechar--aux 1000 t (lambda (_) (random (buffer-size))))) --=-=-=--