From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.devel Subject: Merging scratch/substitute-command-keys to master Date: Sat, 17 Oct 2020 14:03:25 +0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16515"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Oct 17 16:10:11 2020 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 1kTmuR-0004CW-Or for ged-emacs-devel@m.gmane-mx.org; Sat, 17 Oct 2020 16:10:11 +0200 Original-Received: from localhost ([::1]:48636 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kTmuQ-00024d-NN for ged-emacs-devel@m.gmane-mx.org; Sat, 17 Oct 2020 10:10:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kTmo2-0001fS-4b for emacs-devel@gnu.org; Sat, 17 Oct 2020 10:03:36 -0400 Original-Received: from mail-ed1-f53.google.com ([209.85.208.53]:46761) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kTmo0-0003is-3l for emacs-devel@gnu.org; Sat, 17 Oct 2020 10:03:33 -0400 Original-Received: by mail-ed1-f53.google.com with SMTP id 33so5591513edq.13 for ; Sat, 17 Oct 2020 07:03:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:date:message-id:subject:to; bh=Sf0PdUQR6RAQwPws6F5IffATUeeyxZv+w8ATx2Ah1nc=; b=OUNHKmfB6wi3KDEVVm0yGXZ1kLs4FXNgX5kzMoz/aKiM96cabzFhcBStBxgBcWLe33 hjsAuMexZ9ivnDdspo+Mywbbz8gu4rfVP2o7lOChKa1TccmiQkU2MC8ax8frsEOe+5Dh DiNZPzIz5Dkb+TNd2Gu0y0txBXj0X8XKfakvUHxWmnMN0i5kf4/6WqBLlpTv5dJvFfq8 DTF0nMxcwfOaMVcGFe5LKPDNCEqxqcpC6gltyTKro/ablPskpVGY0RaqNV8Y6S+1s1kr DhAZNH16ERFtO5Fbw5NEcrp4LS2PZlPBYNBoeQ89HRWJGPEPpcoj9nnD/SLKPsbZqxW9 KmPQ== X-Gm-Message-State: AOAM533gihLHanVPyUyCKZr7mV7dDk37JLwNyrie8VSNSwqGs82sN9AK 1b6Agq2p5KSP9wJ+Rqg8YQh4Ckx33Z8RoxDymeGFMYz9 X-Google-Smtp-Source: ABdhPJxaV33VTvPhFt0TNbOoKdzHnz3FwdbXSnoNDLNlKIDAdF3B7EUxwlQJsVfLvMmHDPBwgiXvDnkudHJWIIc1T40= X-Received: by 2002:aa7:c259:: with SMTP id y25mr9129372edo.249.1602943405835; Sat, 17 Oct 2020 07:03:25 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sat, 17 Oct 2020 14:03:25 +0000 Received-SPF: pass client-ip=209.85.208.53; envelope-from=stefankangas@gmail.com; helo=mail-ed1-f53.google.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/17 10:03:26 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:257943 Archived-At: I've been working on translating `substitute-command-keys' from C to Lisp, and I think it's getting ready to merge to master. Please see the branch scratch/substitute-command-keys. Note that this is a rather close 1 to 1 translation from C to Lisp, so there should also exist many opportunities to take better advantage of a more expressive language. One obvious concern is performance. Here is what I've used to benchmark it: (with-temp-buffer (dired-mode) (let* ((times 100) (result (benchmark-run times (documentation 'dired-mode)))) (cl-mapcar '/ result (make-list 3 (float times))))) Old C version: (0.02171680510 0.2 0.01730526807) New Lisp version: (0.02775125134 0.24 0.01882684842) [It would be useful if someone could help verify the above results.] I hope the above figures are acceptable. Hopefully, we will be able to improve the implementation to be more performant over time. Finally, note that I didn't yet rip out the old C code, and that the branch is currently based on the master branch from May. Thanks in advance for any comments and reviews. (BTW, do we generally merge branches as-is with their full history or do we squash them and push as a single commit?)