From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Tooltips GC overhead Date: Thu, 30 Jul 2015 19:36:04 +0300 Message-ID: <83pp39wqkr.fsf@gnu.org> References: <55B7796B.3070005@gmx.at> <55B87E3F.80708@gmx.at> <55B8E367.9020201@cs.ucla.edu> <55B8F3E9.5000707@gmx.at> <833806yld0.fsf@gnu.org> <55B915CE.7070803@gmx.at> <55B94267.5050208@cs.ucla.edu> <55B9CD5D.8040302@gmx.at> <55B9D017.1000109@cs.ucla.edu> <55B9E8EB.5090402@gmx.at> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1438274194 3632 80.91.229.3 (30 Jul 2015 16:36:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 30 Jul 2015 16:36:34 +0000 (UTC) Cc: eggert@cs.ucla.edu, emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 30 18:36:27 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZKqok-0007lV-Fx for ged-emacs-devel@m.gmane.org; Thu, 30 Jul 2015 18:36:26 +0200 Original-Received: from localhost ([::1]:41046 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKqoj-0000pf-I8 for ged-emacs-devel@m.gmane.org; Thu, 30 Jul 2015 12:36:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53835) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKqob-0000pT-Lp for emacs-devel@gnu.org; Thu, 30 Jul 2015 12:36:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZKqoW-00059N-Ks for emacs-devel@gnu.org; Thu, 30 Jul 2015 12:36:17 -0400 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:39514) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKqoW-00058O-Bt for emacs-devel@gnu.org; Thu, 30 Jul 2015 12:36:12 -0400 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0NSB00B00790M500@a-mtaout21.012.net.il> for emacs-devel@gnu.org; Thu, 30 Jul 2015 19:36:10 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NSB00BCR7G8MF00@a-mtaout21.012.net.il>; Thu, 30 Jul 2015 19:36:10 +0300 (IDT) In-reply-to: <55B9E8EB.5090402@gmx.at> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:188199 Archived-At: > Date: Thu, 30 Jul 2015 11:05:47 +0200 > From: martin rudalics > Cc: emacs-devel@gnu.org > > >> I suppose you didn't wait until the tooltips really showed up. > > > > No, I waited. > > This is hopeless. Evaluating > > (let ((c cons-cells-consed) > (v vector-cells-consed)) > (tooltip-show "foobar") > (message "cons: %s vector: %s" > (- cons-cells-consed c) > (- vector-cells-consed v))) > > gives here "cons: 58696 vector: 9443". Evaluating > > (let ((c cons-cells-consed) > (v vector-cells-consed)) > (x-show-tip "foobar") > (message "cons: %s vector: %s" > (- cons-cells-consed c) > (- vector-cells-consed v))) > > gets me "cons: 58649 vector: 9443", so the remainder of `tooltip-show' > is responsible for just 47 additional conses. We can ignore that. > > I suppose most of the overhead goes to x_create_tip_frame - a normal > `make-frame' here gets me "cons: 37464 vector: 33018". Calculating the > tooltip position doesn't seem to add much overhead. So the only way to > fix this is to hide tooltip frames instead of deleting and re-creating > them. If this can be done properly. According to my testing, over 80% of consing happens inside face-spec-recalc which is called by face-set-after-frame-default on all the known faces. I guess your numbers above are from a non-Q session with a lot of additional faces, because in "emacs -Q" I get "only" about 15000 conses from a single tool-tip. So maybe one other idea is to skip faces that are obviously unused in tip frames. Or maybe we should just make gc-cons-threshold higher ;-) This is not new, btw: Emacs 24.1 exhibits approximately the same numbers, Emacs 23 conses only two thirds of that, and Emacs 22.3 one third.