From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.devel Subject: Re: Is this "save practice" (setting default font scale)? Date: Sat, 21 Nov 2020 07:33:55 +0100 Message-ID: References: <83mtzcys9g.fsf@gnu.org> <83k0ufzte1.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3308"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 21 07:34:39 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 1kgMTm-0000k3-5J for ged-emacs-devel@m.gmane-mx.org; Sat, 21 Nov 2020 07:34:38 +0100 Original-Received: from localhost ([::1]:52972 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kgMTl-0002dD-5y for ged-emacs-devel@m.gmane-mx.org; Sat, 21 Nov 2020 01:34:37 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45194) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kgMTD-00028g-8E for emacs-devel@gnu.org; Sat, 21 Nov 2020 01:34:03 -0500 Original-Received: from mail-vi1eur05olkn2090.outbound.protection.outlook.com ([40.92.90.90]:28033 helo=EUR05-VI1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kgMTA-0003xh-Hx; Sat, 21 Nov 2020 01:34:02 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n5Eu65IkJeBr2IeBi1vQLUwGh40dMKx+5HCeZgvbtjF+nSC24NC9s5omiv5fEHF+3dZHqrJ5ge9Yd3jlt90Jh0qq4d636zJFLbTkeIvZgRLPjOflTRqWRRw2HHM1u/x3TdtE38CFT0utGmGRk8YvlfSs1zC5OM3t4PPYP7OKLGovxAl9GdVYyuNEzHgdqZSksytH0dK9CMTZAnK8hPTb0XknvYUymOZTxx1GZ8Wx0vz1kSnxRWTurgNjZ+AmRWtaN7eTnEUHlQKU7LCghui1SREPaLSUYHfRVZZjOCvFDfe8TFpGFk0+PA7Fepsi3hCvtKZABfrKJf4Dk5tlibkvLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4pW0a+8CI6jFbPKznHDdoPGbXTc32UFzzdZpwZ+/Vek=; b=llG1bTviaZTlEjZM/BasYHJZbusJoeU6d5G2R/1gVNwNIrYYL96bzEXL/j4a4hQOKV8MSm3TVKBB06ngPLYyg2Gkgp5oWEP4X6i5wXw4+Vg14K1aaVw0ApAJj/W6C3XMkYrFJPaGEZPzgPmiTj2OuqILNdTc25mqJk3qGD2ish6jrkjtgOcwaPPXhC86iNHHhbTiHVDpIxIGOQPIHS934QmtJ4MjcEdQqZn4grOZ0DIXzQ6Y77qSlXBukmVHr3+M5fiZSvrLZ05Tr1QdOmswP116pI7m0PVa9xFmCC2yu2UzoxHN31lRjODiPPbwWBM2ABxTZQ4aAOHuOUsgQ6lorg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4pW0a+8CI6jFbPKznHDdoPGbXTc32UFzzdZpwZ+/Vek=; b=I+vefI2p9njo8IKJ7z8n26dRIrx7VNGWRKLW1jGmanbmuy/7B+0IlyDsyNBMzAZzX8S0PBsDbd1kdQxEltbRCm7TT3D6DPYBNH/Iw+UYEIzOaCaG11ewpHqVEXMejOIeD5JB3zeMYu2lYV9bJUDrZYIYH68kKzzdjDcTWDbtp1C/5QTKww6WWfdl/0D1aJAuPLiuhSuBfBd1OfiZi17Po0I+WL/XZJwkvI6WwdKYh4ljDCZOw0unGKNhPsEm3sEcXhZEm9HJ9yAHtzGsu10alPs9kptwYjscfF7H4gNXmZQA40avfbFKcOmjCYqCjqf+f426MyfySXJrx1jiam+9Mw== Original-Received: from AM6EUR05FT049.eop-eur05.prod.protection.outlook.com (2a01:111:e400:fc11::47) by AM6EUR05HT217.eop-eur05.prod.protection.outlook.com (2a01:111:e400:fc11::316) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.20; Sat, 21 Nov 2020 06:33:57 +0000 Original-Received: from AM0PR06MB6577.eurprd06.prod.outlook.com (2a01:111:e400:fc11::51) by AM6EUR05FT049.mail.protection.outlook.com (2a01:111:e400:fc11::413) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.20 via Frontend Transport; Sat, 21 Nov 2020 06:33:57 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:F172203245FF5A1C212E5E98F814E211CAE045F38FF0D04605BE3D297FBA6AA5; UpperCasedChecksum:B6A7858C5F02FFF6B09FD66D955A2516FB33802524EE34F30B59ED7F2212D274; SizeAsReceived:7577; Count:46 Original-Received: from AM0PR06MB6577.eurprd06.prod.outlook.com ([fe80::9487:8c7d:da00:4993]) by AM0PR06MB6577.eurprd06.prod.outlook.com ([fe80::9487:8c7d:da00:4993%7]) with mapi id 15.20.3589.021; Sat, 21 Nov 2020 06:33:57 +0000 In-Reply-To: <83k0ufzte1.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 20 Nov 2020 22:05:10 +0200") X-TMN: [g98zAHiCRx7KGEpBCPgjYpKXJPyFPvlO] X-ClientProxiedBy: AS8PR04CA0056.eurprd04.prod.outlook.com (2603:10a6:20b:312::31) To AM0PR06MB6577.eurprd06.prod.outlook.com (2603:10a6:208:19a::23) X-Microsoft-Original-Message-ID: <87k0uf2p7w.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (90.230.29.56) by AS8PR04CA0056.eurprd04.prod.outlook.com (2603:10a6:20b:312::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.20 via Frontend Transport; Sat, 21 Nov 2020 06:33:56 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 0956a41e-b8d5-4920-d2ab-08d88de76c6e X-MS-TrafficTypeDiagnostic: AM6EUR05HT217: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: afiQKkU6o+ZAF/oLj4h3JvS78wPIk/adkQ5d940JCqlhxMBFlowRP5kCT9QQo49lZEtS1Hj3ZQd/i5DlNq0KepS8o+j47XJwaiiwVsdv4z6MOjRm0bOdUmzqxbacNdwYDBCpcZEuSWrGuKuQOkRnr5jhZ7Uc7M6J/ZolLMIIqEfF18kMyG+z3MJTeYuu+/hTpoGLSS46CTAqkKerbh+tHQ== X-MS-Exchange-AntiSpam-MessageData: Uf2AQVmSDIPEjtpVs0fvaEomCbWBUxSgJxt0N95HVUIrtXiVZebjf5XwFnO4cBQV8ez/YieSMChJlGGgG8YTWd3TYTBKULUk7JyAyuFuPQFpUZmjZNWsIQYC+eS9d0EwDYO2bXfqamgsn6CObsleHA== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0956a41e-b8d5-4920-d2ab-08d88de76c6e X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2020 06:33:57.3101 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: AM6EUR05FT049.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6EUR05HT217 Received-SPF: pass client-ip=40.92.90.90; envelope-from=arthur.miller@live.com; helo=EUR05-VI1-obe.outbound.protection.outlook.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, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-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:259513 Archived-At: Eli Zaretskii writes: >> From: Arthur Miller >> Cc: emacs-devel@gnu.org >> Date: Fri, 20 Nov 2020 16:37:51 +0100 >> >> > The pitfall is that the change in the default face will not be >> > propagated to other faces that depend on 'default' (inherit from him >> > and don't specify their own size explicitly). >> Si, I understand. Does Daniel's answer (custom-set-face) have same problem? > > No. But I don't expect it to provide any speedups, either. I guess speedup comes from not re-doing work after the frame is created. I did some measuremets: (benchmark 1000000 (custom-set-faces '(default ((t (:height 140)))))) (benchmark 1000000 (set-face-attribute 'default nil :height 160)) In synthetic comparison as you say say there is no difference at all Those two seem to execute roughtly about same time, ~0.017. But when I switch between (custom-set-faces '(default ((t (:height 140))))) and (add-hook 'after-make-frame-functions (lambda (frame) (set-face-attribute 'default nil :height 160))) I can measure ~100ms slowdown regulary. It has to be the double work. Another interesting thing I found is this executes a magnitude faster then above two benchmarks: (benchmark 1000000 (aset (cdr (assoc 'default face-new-frame-defaults)) 4 140)) Yet when I use it in init file, I see no difference in startup time compared to custom-set-faces version. I guess it is too little difference when it comes to other things going on at startup.