From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "T.V Raman" Newsgroups: gmane.emacs.devel Subject: Re: Enabling native compilation by default when libgccjit is present Date: Tue, 07 Dec 2021 09:02:12 -0800 Message-ID: References: <83wnkm94oq.fsf@gnu.org> <87y251vdeh.fsf@gnus.org> <87lf11tlzf.fsf@gnus.org> <87r1atrsp9.fsf@gnus.org> <8735n85fa5.fsf@gnus.org> <87r1arskmq.fsf@gnus.org> <87r1arsjpu.fsf@yahoo.com> <87ilw3sjlr.fsf@gnus.org> <87r1ar4mi2.fsf@gmail.com> <874k7nw32n.fsf@gnus.jao.io> <87mtlfasg4.fsf@telefonica.net> <83zgpd28km.fsf@gnu.org> <83o85t25d2.fsf@gnu.org> <87czm81jzn.fsf@rfc20.org> Mime-Version: 1.0 Content-Type: text/plain; charset=gb18030 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26398"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Eli Zaretskii , Stefan Monnier , ofv@wanadoo.es, rms@gnu.org, emacs-devel@gnu.org To: Matt Armstrong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 07 18:05:37 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 1muduJ-0006ZT-1F for ged-emacs-devel@m.gmane-mx.org; Tue, 07 Dec 2021 18:05:35 +0100 Original-Received: from localhost ([::1]:41056 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1muduH-0006YF-CE for ged-emacs-devel@m.gmane-mx.org; Tue, 07 Dec 2021 12:05:33 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:40422) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mudrC-0002Ki-AZ for emacs-devel@gnu.org; Tue, 07 Dec 2021 12:02:24 -0500 Original-Received: from [2607:f8b0:4864:20::102c] (port=42919 helo=mail-pj1-x102c.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mudr9-000473-Bt for emacs-devel@gnu.org; Tue, 07 Dec 2021 12:02:21 -0500 Original-Received: by mail-pj1-x102c.google.com with SMTP id fv9-20020a17090b0e8900b001a6a5ab1392so3229919pjb.1 for ; Tue, 07 Dec 2021 09:02:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=S1tf6NjICt04KdJIV5lx/n9dGQyYIB3v/C8k6ZHw0a8=; b=sofMx28gaxrYizA/A7TkzIMEb8jnTrEKW+RCoriSfaq0MzoKpluNQGdvzRxu+GgQSL 6iE5l8+aIzq+fAkVDimrjxkDjLM3deTchqy8Veu9Yg5hpIjCl/oII3UvVdwC9T1E2RKq kTX5daJ4y87vJwF285zl3ZbiPuvEnvuQ+MofPwULk3rrJqFnfZDZjTFZzY0GuAQHuNoU 4n9roi8nSUFjkXiBZakHga3flvSPjpDt2YCFEFLQ3bSi6yTjV3OLwKhH0T9GRIk4OZyi 4l7s2kFgIHOcaaKOj0iXYlYcAjao97zsBO9/nIabhFuNV4U2P1IhTborKeuZWmWJgSr7 4WtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=S1tf6NjICt04KdJIV5lx/n9dGQyYIB3v/C8k6ZHw0a8=; b=DCu5wZYplXclijk+Ao5wKhPHNBkjKd36e4XDJ9c4GdF1koorX85YcNba4H+EWApMvZ UG6hdJIu50HyzQVI6T28JkO5cMKv6244di/w0npNNPKj2ck3++k/Ia8YNNPakQZAIxr8 2+V4nB4G7IPrgkp/Pg+WhYPNC60ivWT94QdtvbCcaJXZK0px9rk7OM4oTti2fnX7LGbP /bJ/vJGaOzJqPj6fZjOZSN/R10izt74pg29sFzmlSC5lpKO11klokIB9iGcTVMMj3jk+ dZYzhWutBWNtYAzS44d6WbTdeULS65pD+Znfq4x6+kIYAC5EPDee+P5dfL3uSnrYoLXt 4jdQ== X-Gm-Message-State: AOAM5331uov26nFAAWxZEL0lSjGw8eiACA6qEgS7CNc7cdm6K3DGc65R XqgQqeU4fWaq2Ww0aHies6DxT92bJTgY3g== X-Google-Smtp-Source: ABdhPJz0AZOa6AknOGuS7TfPqA3/h3dli4OmYS9TStfB2VJ5uHgaBlte1nWddhGvaTvmM3h/e40ZEA== X-Received: by 2002:a17:90b:2412:: with SMTP id nr18mr355903pjb.233.1638896535810; Tue, 07 Dec 2021 09:02:15 -0800 (PST) Original-Received: from raman-glaptop (c-24-4-174-65.hsd1.ca.comcast.net. [24.4.174.65]) by smtp.gmail.com with ESMTPSA id h15sm237440pfc.134.2021.12.07.09.02.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Dec 2021 09:02:14 -0800 (PST) In-Reply-To: <87czm81jzn.fsf@rfc20.org> (Matt Armstrong's message of "Tue, 07 Dec 2021 08:02:20 -0800") X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::102c (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=raman@google.com; helo=mail-pj1-x102c.google.com X-Spam_score_int: -167 X-Spam_score: -16.8 X-Spam_bar: ---------------- X-Spam_report: (-16.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, ENV_AND_HDR_SPF_MATCH=-0.5, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5, USER_IN_DEF_SPF_WL=-7.5 autolearn=no 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" Xref: news.gmane.io gmane.emacs.devel:281267 Archived-At: Matt Armstrong writes: The best explanation I have heard on this was from Stefan a while ago where he pointed out that the .eln files should be generated from the .elc files, not the .el files, see that thread. The warnings are annoying but that is not the worst of it, some of them --- likely a small number are real. In the past when I have said this, Eli has challenged me to file bugs for each one, but that is infeasible --- so for my own use I've disabled native-comp and moved on. Andrea -- you've done wonderful work here, but please make sure that the last mile isn't left unpaved ---> Eli Zaretskii writes: > >>> From: Stefan Monnier >>> Cc: rms@gnu.org, ofv@wanadoo.es, emacs-devel@gnu.org >>> Date: Mon, 06 Dec 2021 08:57:40 -0500 >>>=20 >>> > I don't think this could fly in practice, because I see no way of >>> > predicting when it will provide a benefit. >>>=20 >>> I'm pretty sure it can fly in some practice, but I think it would have >>> to be a JIT rather than AOT compiler: rather than having to predict the >>> proportion of time spent in subrs vs time spent in bytecode.c, it could >>> measure it and (re)compile the parts that seem most promising. >>> I think Java's HotSpot compiler was among the firsts to do this kind >>> of thing, but I expect it's fairly widespread in JIT compilers nowadays. >> >> Sounds like a good idea for a PhD. > > Indeed, PhDs have been completed in this area. > > Beyond hot spot, JIT in dynamic languages can use other techniques, such > as specializing the JITed code to the concrete types the code sees in > practice, etc. I'm not an expert so I'll stop there. > > I find the approach taken by Ruby's new YJIT interesting. They achieve > low "warm up time" before reaching peak performance, and the approach > doesn't significantly reduce the performance of not-yet-JITed code. > > https://shopify.engineering/yjit-just-in-time-compiler-cruby is a good > summary. The primary lead on he project recently got a PhD in the > technique used. > > I don't see any technical barriers preventing Emacs and/or Guile from > taking the same kinds of approach, but it would be a large effort, > requiring deep expertise. It might make more sense to do it in Guile, > in the hopes of making Guile Emacs an attractive proposition. > --=20 Thanks, --Raman(I Search, I Find, I Misplace, I Research) =817=A94 Id: kg:/m/0285kf1 =950=DC8