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: Image transforms as a benchmark? Date: Sun, 12 Sep 2021 19:50:25 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9599"; 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: Alan Third Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Sep 12 19:52:19 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 1mPTeM-0002IF-Qm for ged-emacs-devel@m.gmane-mx.org; Sun, 12 Sep 2021 19:52:19 +0200 Original-Received: from localhost ([::1]:34492 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mPTeL-00075f-TK for ged-emacs-devel@m.gmane-mx.org; Sun, 12 Sep 2021 13:52:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53470) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mPTcd-0004Fe-SN for emacs-devel@gnu.org; Sun, 12 Sep 2021 13:50:31 -0400 Original-Received: from mail-oln040092068029.outbound.protection.outlook.com ([40.92.68.29]:25669 helo=EUR02-HE1-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 1mPTcb-00029Z-Dg for emacs-devel@gnu.org; Sun, 12 Sep 2021 13:50:31 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=glDcQsVtx5YHRhQcz3wwVHbFhTNTntWreQsbHNvMc3laSF6qyXzVwMqQJwQTXYH+mA013D0pTNsmXRvc+3Nm3c1TW4lvuqqoc81XWiA7swNNgdS09ro6XgnyyrpyPcT2GuAqj7fVVXdLftBXz9PhSMmtu9GiVOzVcyJKKTGXV6YUvVX0e7Ckff57p8x3hwx1I9CBFf8E3com3FHe+k8Y2UkfacOgOOJIBdLVnaK/0BiIuZdsmxu7i/UQ0rdlgaRnV1XO28rbA2DeaIshSF48Is6qRXEjqqoopa9LaINFQlaKSgMrYw0HfgbZ40meJm/88Ng6VCvDK5D0Ngk6MRwE6w== 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; bh=JkvCYBopmZck6/bratojED7SAME2X/PrzaTetIdFfpU=; b=TsQs4Dy+SNVkpLeB0co2nTuTKBRwbUJLF2jmo6ZijZJ3mmED8uRnr4sCP4RmprtZdpiwy4lDxO8GwybpfmdsHAHTan7wZ43SKIhZSHNEU0co5V1lOrap5k8+UpUytfOaH5H65XubNVJzoWgPyaNMyc68K508gUeu0QRDPww8jy+RbwuZRM0HlBAYcFLUFL3cJ5/2nZrFHMQYfbA2x2/pqx9x9X1JBn4KY7bkvrvJx8lIcJqDavPbag/GE5GLKKWnu/vEBmc2JTEfhzS/P7QfSX9McvDnaPV1XzNKERPuyjre4iDZ0CN78NJBIcEKOnUfW7jjvOsiocDyrJs6PCBT3A== 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=JkvCYBopmZck6/bratojED7SAME2X/PrzaTetIdFfpU=; b=tt1/YcNJRCksjeZhTlNtuYKwEek9TRjrU7BRsZeeNLELN68GdgZ8BdUqzAjTgB8yLt5VL5O2yKjTjARF3Mhm5zRX17Gd6YgNe7q/6Wm0XFW5ch47wJGMwI7eFL12lMdxHot1Id89UsIh55A66BviyFRa0y9+cR3taaoGlgFgngTDGkDmURX6fpO//7lpms+AuQshAQUtgYhkrEeKc0I+Gbte79x1s3ZyDMKG/jifd+cqoCKZkNrNYtOUHeGAToRjLZ108NYfzaNua6lGkfyl6qIDxDOXE0as5HN1n3CS8lQlH3KSA2gntKPIww/ZqU9RQLknTUzBW5KkXMe7ZA5mRQ== Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) by AM0PR09MB2835.eurprd09.prod.outlook.com (2603:10a6:208:12b::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.16; Sun, 12 Sep 2021 17:50:26 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::c55c:ece5:bed2:a9dc]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::c55c:ece5:bed2:a9dc%8]) with mapi id 15.20.4500.018; Sun, 12 Sep 2021 17:50:26 +0000 In-Reply-To: (Alan Third's message of "Sun, 12 Sep 2021 16:50:12 +0100") X-TMN: [psrjUDHdcm/u0CwdrDWhhtHA4eHvfcPI] X-ClientProxiedBy: AS9PR06CA0015.eurprd06.prod.outlook.com (2603:10a6:20b:462::6) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <87o88xlm3i.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (81.232.177.30) by AS9PR06CA0015.eurprd06.prod.outlook.com (2603:10a6:20b:462::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Sun, 12 Sep 2021 17:50:25 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5ed41c47-38e8-4460-1d39-08d97615cd10 X-MS-TrafficTypeDiagnostic: AM0PR09MB2835: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3H1PQ8jTPGIXWCr/G1fJVCQXPo0fbl5SI2929v8kTAJJVFFd7ptzqYJCfpLa6Z1vD7sHg1c7f31FANSqg7i7MKhzS6d4SVfU/eSLzRB6vUfN4YLs1ot+zgDC6alPwQXKy4OJG8gQW5ZJ6hPEYuiXmGZwLB98FeUxfs0NSqcE7ajJLdpkH41vkwwdWf4j807G+LoJixNpU7zrqV5hxtAYluUdeDTU9dd2kSDUvOIDy1koTvRrERv/34WJa7Ho/16DSPOcp+tLNn8ZsKlI7FYGfoe9OWoFC5lS0IbOUrOinBMK0pZzrIjogwRzvnWh+e4RqWAkSxKHATF0qOpvAiS2SpRTD6QbCFMTqo7R0tfEqzK0NBmtNEeiVhPi3VW6xqeKY+9/JPTX1TDvSsg+isSFvVDXCfz+llzrHbVI4aKSEKw5cooMHejwPe8V6rlYLna1 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: J30HX3TU5+0XPVjJsEbqv5hLOygYbrNGQwSwnnHoY7dsUDnVjmB2dzCkDoLHo5Ml0sqS9NSGW4pfZ2fujh6R6erCjgfPqdXi9wREfiIyg462xPgPdyQw5YIi59Dwqzp/BqZM7kL1410V44uzL6AQaw== X-OriginatorOrg: sct-15-20-3174-20-msonline-outlook-72e6e.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 5ed41c47-38e8-4460-1d39-08d97615cd10 X-MS-Exchange-CrossTenant-AuthSource: AM9PR09MB4977.eurprd09.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2021 17:50:25.9617 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR09MB2835 Received-SPF: pass client-ip=40.92.68.29; envelope-from=arthur.miller@live.com; helo=EUR02-HE1-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:274604 Archived-At: Alan Third writes: > On Sun, Sep 12, 2021 at 03:28:09PM +0200, Arthur Miller wrote: >> Alan Third writes: >> >> > On Sun, Sep 12, 2021 at 01:45:39PM +0200, Arthur Miller wrote: >> >> >> >> I tried to make another little benchmark, I saw with optimization flags, that >> >> quite some loops have got unrolled and vectorized in image.c, so I wanted to see >> >> if it matters when doing some transforms on images. I tested so far just with >> >> svg. >> >> >> >> I wonder if image-rotate is handled completely by external libraries? I see >> >> no effect on performance, regardless of how many time I rotate some image. Is it >> >> same situation for scaling down? I see big difference when scaling up images so >> >> I guess that is handled by Emacs own code? >> > >> > SVG is probably not a great example for testing image transforms, at >> > least if you're using the master branch. >> >> I wanted to make few benchmarks that are relevant to normal use. I do some >> searches, replacements and similar in a big text buffer (Plat's dialoagues as I >> posted a day before), and I did some symbol lookups in Emacs lisp sources. SVG >> is getting a bit of uprise lately, so thought it might matter. But I'll guess >> I'll skip SVG then. > > Well, don't let me put you off if you're bench-marking things that > actually matter. I assumed it was a purely intellectual exercise. Yes, but it's no idea to measure wrong thing either :). >> > Image scaling in SVG is handled at the time the image is rasterized, >> > so if you ask for the image to be doubled in size, the rasterizer >> > creates a bitmap that is twice the size. >> >> Yes, I saw the code. But I wasn't sure if it does upscaling itself, or it >> outsources the entire venture to librsvg & co. I understand the most of image >> operations are handled by 3rd party libraries. I saw some code for image >> transforms in image.c, but I haven't looked much where it is used and so, maybe >> I should have :). >> >> Why is it so drammatic difference then when scaling up compared to scaling down? >> It takes like 5 seconds to do that loop in scale-up test, but just a fraction of >> a second when scaling down. I tested little different versions, and I see the >> effect, so scaling is done. > > I have no idea. Both scaling up and down are performed by librsvg > itself. It may be some side-effect of the way we do the scaling, with > the wrapped SVG, but I don't have enough knowledge of librsvg to know > why. > > Alternatively we're doing something wrong that I haven't noticed. > > Is it possible to use a profiler to find out which calls are slow? It probably is, you are correct :). I haven't tried; I should have. When I am done with some benchmarks, I can take a peek. Thanks for the help!