guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Breaking hygiene with syntax-rules?


From: Thompson, David
Subject: Re: Breaking hygiene with syntax-rules?
Date: Mon, 14 Aug 2023 15:26:47 -0400

Hi Walter and Arne,

On Sat, Aug 12, 2023 at 2:09 AM Dr. Arne Babenhauserheide
<arne_bab@web.de> wrote:
>
>
> Walter Lewis <wklew@mailbox.org> 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’s by dthompson who AFAIR once
> showed millions of interacting points with Guile 3). I would expect that
> the to-pointer becomes fully inlined, so it’s 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]