[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: question about large-scale use of Pitch objects
From: |
David Kastrup |
Subject: |
Re: question about large-scale use of Pitch objects |
Date: |
Wed, 08 Aug 2018 17:36:14 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
David Nalesnik <address@hidden> writes:
> On Wed, Aug 8, 2018 at 10:15 AM David Kastrup <address@hidden> wrote:
>>
>> Pitches as a data structure contain one allocation.
Ah, not quite, I forgot an indirection. One SCM allocation (standard
size) and one C++ heap allocation (data structure size).
>> In contrast, a list contains one allocation for each element (short
>> of immediate SCM data types which small integers are) and one
>> allocation for its containing cons cell each. Those allocations are
>> of a "more standard" size but I doubt that will make all that much of
>> a difference.
>>
>> So I suspect that you are likely to end up worse than what you started
>> with.
>
> Thank you, David, for your explanation. This will save me quite a bit
> of wasted effort.
Lists can be modified in-place (but only if you don't need the
original), Pitch data structures will always require a new allocation.
Still I'd be surprised if the lists end up the better choice.
--
David Kastrup