From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Aaron Jensen Newsgroups: gmane.emacs.devel Subject: Re: macOS metal rendering engine in mac port Date: Sat, 29 May 2021 14:03:08 -0700 Message-ID: References: <83k0ni6pje.fsf@gnu.org> <83eedq6mvm.fsf@gnu.org> <83zgwd6gk3.fsf@gnu.org> <83bl8t5vu6.fsf@gnu.org> <83a6od5tqh.fsf@gnu.org> <834kel5qp3.fsf@gnu.org> <83zgwd489j.fsf@gnu.org> 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="23083"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Alan Third , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 29 23:04:08 2021 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 1ln67s-0005lw-KP for ged-emacs-devel@m.gmane-mx.org; Sat, 29 May 2021 23:04:08 +0200 Original-Received: from localhost ([::1]:54042 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ln67r-0008Q8-NN for ged-emacs-devel@m.gmane-mx.org; Sat, 29 May 2021 17:04:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57054) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ln67D-0007iT-4A for emacs-devel@gnu.org; Sat, 29 May 2021 17:03:27 -0400 Original-Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]:44908) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ln677-00010h-Tt; Sat, 29 May 2021 17:03:26 -0400 Original-Received: by mail-pg1-x534.google.com with SMTP id 29so5268138pgu.11; Sat, 29 May 2021 14:03:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=guHvjw2LvT/6LERNObPg1sYWvloUE/fLin3eb1q3mc0=; b=pxOP/YN/4km2Op1zkPYdK1ATpkZaLoMXD+uXqGgOcR0O6KM3CcK9rkMnGrOJIpgQ/x 3YbGk7LjdTKJk8D/dknLAyuO3/yi//b6hQORLarNoRsKHYlKXJqdIzLVO7Bpo8lH/+rz J+h59ulRuSxfmQQ/S8wlolf1jOgzLSfRJ0xG+4fTLMp2aDiTRoH7XSkJGl294ln3BKHZ q83QCjJZR1JzAeNpnWVmsqSPBtkwGJQZ/E+xdZhF/nmdh2tu5XjBHPhxRvYb8I7IN1Qr 3XR9Hgmr2vpY5iDrDZGUBB0qyvmdEJPvYI1i6qpC4cID9NpWeXc0vF0MIReI+yYl1mIS 4OGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=guHvjw2LvT/6LERNObPg1sYWvloUE/fLin3eb1q3mc0=; b=gm31/iqAMPMPWX75REnhGjm1CN9zLm09NCVO7haiWUjAsQ3B4pU47HzOElX2tNLg+d /XN2cTJeIVsaFVyOqbByWDwZOZRRQGaieH23ZJoA5d+PgOwPCrDCPsX4W7OoI+dZAcgk J3rBYMi2UWBQkzJ0AyhFnwzEO89Aw0SIf5jmomPBUvGIETUVRZodJNC7HsBxa9dOq03h UUWZcHJpPijQDVxQxOUFFqL/PlrBS5zi5/JmOTOBzqJD3Itgxc3eahNqChoqoIhHcTR5 3VQM1PaqK2cviikfFxlOJlczP1sTzUuW39IH9eBSiB+sE1Y4MhXiY/Ya0ws2G2/vtLGp aw7A== X-Gm-Message-State: AOAM531ceJV65ugTJv3uXsWouwT6gehugunj6hjws86apjIZg+ydZ4k4 scohPfNY2azgKUSd0MlKMuorbqYBHqrS305Gltib5EgQyKH6Nw== X-Google-Smtp-Source: ABdhPJxLZ9YOm+QPSP7h++cItRxq6DrHVwlqlEIEyBxQlbWo5FgYH5NRFxIrZBLg4o1p4mxO2PE12Gd73MaTMN1Pdvk= X-Received: by 2002:a65:5305:: with SMTP id m5mr15554105pgq.155.1622322199252; Sat, 29 May 2021 14:03:19 -0700 (PDT) In-Reply-To: <83zgwd489j.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::534; envelope-from=aaronjensen@gmail.com; helo=mail-pg1-x534.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.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:270098 Archived-At: On Sat, May 29, 2021 at 1:03 PM Eli Zaretskii wrote: > > > From: Aaron Jensen > > Date: Sat, 29 May 2021 12:30:49 -0700 > > Cc: Alan Third , emacs-devel@gnu.org > > > > > OK, but still: assq_no_quit should be very fast. > > > > Sure, it's fast when you call it once, but it's not being called once. > > It's being called enough times that it adds 10ms to every key press > > when I have line numbers on and 1000+ faces. > > In a 64-bit optimized build, assq_no_quit's loop body is just 10 > machine instructions. With 1200 faces, searching all of them once > should take something like 500 nanoseconds, i.e. 0.5 microsecond. > Does this match the times you see and the number of times the function > is called? > > Also, please note that typing a single character redisplays just one > line, the one where point is. That perhaps needs to merge 4 or 5 > faces. So I'm not sure how come this could add 10ms to every > keypress: you'd need 20,000 calls of assq_no_quit to account for 10ms. > How come we call assq_no_quit 20k times when processing insertion of a > single character? So with a single keypress I see: 6,000 lface_from_face_name_no_resolve 19,000 assq_no_quit So yeah, that about accounts for 10ms > > > > My theme is set up like this: > > > > https://github.com/aaronjensen/nano-emacs/blob/master/nano-theme.el > > > > > > I see a lot of :inherit there. I'm quite sure this exacerbates the > > > problem, as each :inherit needs to recursively search for and access > > > the attributes of the parent face. > > > > It only navigates the parent when the face matches, yes? > > Which face matches what? > > Emacs needs to access the parent face each time it merges the > inheriting face with another one, because it needs to resolve all the > attributes of each face it merges. Sorry, I mean having 900 new faces with inherits shouldn't change the time it takes to merge faces for a single face. In other words, inherit only adds instructions when the face being merged has inherits. It doesn't add it when 900 not-being-merged faces have inherits.