lilypond-devel
[Top][All Lists]
Advanced

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

Re: Use vectors rather than lists for skylines. (issue 583750043 by addr


From: David Kastrup
Subject: Re: Use vectors rather than lists for skylines. (issue 583750043 by address@hidden)
Date: Fri, 24 Apr 2020 15:15:02 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

address@hidden writes:

> Here is how I have experienced this discussion:
>
> DAK: this is micro-optimization that causes memory fragmentation.
>
> HW: No, it's not; here is a benchmark that shows decreased memory use as
> well.
>
> DAK: We could use even different data structures in the future.
>
> HW: This seems very philosophical to me.

It is interesting that you call it "philosophical" to want to change
data structures while getting a patch of yours reviewed that wants to
change data structures.  In particular after I indicated that I even
have code.

Why is it "philosophical" when someone other than you does it?

> Maybe I misunderstood, because the hardcoding of a specific STL
> container type predates this patch.

Changing the used container type would be a reasonable point of time for
changing the hardcoding, particularly since it facilitates comparisons.
Also C++11 makes this considerably less awkward than previously, and
code written with lists in mind tends to require less adaptation to use
via vectors than the other way round, anyway.

It's not just the time that a computer may save when going through the
code that is important.  Humans are worth consideration as well.

> If you want me to use "auto" instead of
> "vector<Building>::const_iterator", can you just point to the line in
> the code and say "could you use auto instead of an iterator here"?

Wouldn't "everywhere" be sort of obvious?

> https://codereview.appspot.com/583750043/

-- 
David Kastrup



reply via email to

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