From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Thompson, David" Newsgroups: gmane.lisp.guile.user Subject: Re: Breaking hygiene with syntax-rules? Date: Mon, 14 Aug 2023 15:26:47 -0400 Message-ID: References: <4d1a63061435cc0cd5f357cc2795d17844510b52.camel@abou-samra.fr> <44a09148-a6a9-475a-c24c-656202c9cbed@mailbox.org> <1f5c2e6b-5c04-7d56-18c1-276bc7b36a01@mailbox.org> <3b9c8777ca81c3d40e6df9d1e97ee12a59ead3d5.camel@abou-samra.fr> <87cyzszt9p.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24688"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Walter Lewis , Jean Abou Samra , Guile User To: "Dr. Arne Babenhauserheide" Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Mon Aug 14 21:28:20 2023 Return-path: Envelope-to: guile-user@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 1qVdEh-00069l-V9 for guile-user@m.gmane-mx.org; Mon, 14 Aug 2023 21:28:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qVdE9-0001td-3u; Mon, 14 Aug 2023 15:27:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qVdDR-0001ke-GF for guile-user@gnu.org; Mon, 14 Aug 2023 15:27:01 -0400 Original-Received: from mail-qt1-x830.google.com ([2607:f8b0:4864:20::830]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qVdDP-0007Qw-Ms for guile-user@gnu.org; Mon, 14 Aug 2023 15:27:01 -0400 Original-Received: by mail-qt1-x830.google.com with SMTP id d75a77b69052e-4103c24a989so17754161cf.1 for ; Mon, 14 Aug 2023 12:26:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=worcester-edu.20221208.gappssmtp.com; s=20221208; t=1692041218; x=1692646018; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=3/TnEC0tIN45cXnSVXMIEAW78VGNiopHJhuHPw6FPFM=; b=ZH0+ydzSaFxgaW6mEPhMlUK+TjjM+a4x9+MKIxcHXbJuoDe2oPrfhx1Aew3ogB6Dsg C/66CiN1upWefHvq7z/vPvm8i9F0XPlQrryJvWIkpR88uOyK/VxVVG2KbTirFzq3FJ6B MEbqqZZ8X+KzlK41TAHZFOnRwrUeccy7oj342SsWzPL8S+o5hP9RzXg3V4esEx8TGgPY MHnDMqPiWX0PLP1qhz/gVBe1gJ8x1HmNiAWo6p0ahn2pgY+6i77Bpdyn3YV81wClTbES Jx5mH4qoDCdwkFw9FBi3FcuOA7rcNUmgkCuNH5CMAxCllC8BYtkxS/12jI6kSuy46I+z byAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692041218; x=1692646018; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3/TnEC0tIN45cXnSVXMIEAW78VGNiopHJhuHPw6FPFM=; b=SQPDyy1nHO8KldkO+G3VPD3OzaWF1z71zSisFTagJDKzeQvq3qMgev8nFNMhLB90lQ wEtJNO7um2Hrol7rp/y3DrxAeiab9z1QamS7jLjfgN6q0zlrlVr/Ci1p/ukWb/K78tl+ vyJ0Dm8+zQfYAeUrDe2SAqyaQjLKEOgJd5elCIrTFCgpFuhxyTZW6LhpfUVw92taenIU KgsOaS36349uxtz3/yUOD3wzEpfeUSs/5ppfiTAbF+1KZDfYqufGSf56q/FYNgwnJn8o tHzxSPEalvT2/mUhgTREv0tPukgIhmiBq0q6k17M/9j1vfgztfaH1YQ/U/uqXcJ+QKCn FXqg== X-Gm-Message-State: AOJu0YwFrcMxYg/1Hl5L3cm16lZ/0SxpVqVAWXKUNFUJOLvZ57RLVQtn nrCXvOpHzqkHHHMY3T1RhJdkn7Qei5vK5x5FC8pZ7w== X-Google-Smtp-Source: AGHT+IGGZxg5BPi35yd6eftIF4PuewciKizbz4HVfjvmuicgFoIS0Ad7rxDykj7fdDc7PnFXfUc1/AGU/DIvYamKtOU= X-Received: by 2002:a05:622a:1d5:b0:403:a940:dc88 with SMTP id t21-20020a05622a01d500b00403a940dc88mr13420848qtw.20.1692041218533; Mon, 14 Aug 2023 12:26:58 -0700 (PDT) In-Reply-To: <87cyzszt9p.fsf@web.de> Received-SPF: pass client-ip=2607:f8b0:4864:20::830; envelope-from=dthompson2@worcester.edu; helo=mail-qt1-x830.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, 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: guile-user@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.user:19161 Archived-At: Hi Walter and Arne, On Sat, Aug 12, 2023 at 2:09=E2=80=AFAM Dr. Arne Babenhauserheide wrote: > > > Walter Lewis writes: > > >> By the way, I'm rather confused as to why you deem this caching > >> useful. A priori, I would expect a simple bytevector->pointer call > >> would be just as fast as a to-pointer call. Do you somehow create > >> lots of pointers to the contents of the same bytevector so that weak > >> references they hold incur a noticeable GC overhead? > > > > To be honest I don't know enough about C to know the performance of > > bytevector->pointer, so I was assuming Chickadee's approach was done > > for a reason. > > Chickadee is pretty heavily optimized (it=E2=80=99s by dthompson who AFAI= R once > showed millions of interacting points with Guile 3). I would expect that > the to-pointer becomes fully inlined, so it=E2=80=99s optimized away. The reason the pointers are cached in Chickadee's 2d/3d vector types is because it's fairly common to need to pass the contents of a vec2/vec3 to some OpenGL FFI binding. Most OpenGL calls happen while rendering a frame, so calling bytevector->pointer around 60 times per second for each vector that needs to be sent to OpenGL generates a lot of garbage. I have to avoid generating garbage wherever possible in Chickadee to reduce noticeable GC pauses in the rendered game. If you're not dealing with these types of performance constraints then it is definitely simpler to not cache pointers. - Dave