David Nalesnik <[email protected]> writes:

> On Wed, Aug 8, 2018 at 10:15 AM David Kastrup <[email protected]> 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

_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to