comp.lang.ada
 help / color / mirror / Atom feed
From: John Perry <john.perry@usm.edu>
Subject: Re: advent of code day 11
Date: Fri, 11 Dec 2020 15:45:18 -0800 (PST)	[thread overview]
Message-ID: <ba3477e0-daa8-4bbe-a18e-044f4f70b40bn@googlegroups.com> (raw)
In-Reply-To: <rr0shg$pc4$1@dont-email.me>

On Friday, December 11, 2020 at 4:40:51 PM UTC-6, Jeffrey R. Carter wrote:
> I don't see a need for a swap, or to avoid copying. I did 
> 
> Current : Floorplan := Read; 
> Future : Floorplan := (others => (others => Floor) ); 
> ... 
> 
> Current := Future; 
> end loop All_Rounds; 
> 
> which took 34 ms, well within the timing requirements for the problem.

I agree it's not needed in this case. I raised the question simply because I'd like to know how it could be done in cases where it might well be important to save the time. I've sometimes shaved significant percentages of running time off programs by doing nothing more than avoiding copying arrays.

  reply	other threads:[~2020-12-11 23:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-11 17:07 advent of code day 11 Stephen Leake
2020-12-11 18:24 ` John Perry
2020-12-11 19:07   ` Jeffrey R. Carter
2020-12-11 19:29   ` gautier...@hotmail.com
2020-12-11 19:35     ` gautier...@hotmail.com
2020-12-11 22:40     ` Jeffrey R. Carter
2020-12-11 23:45       ` John Perry [this message]
2020-12-11 23:49     ` John Perry
2020-12-12  9:38       ` Maxim Reznik
2020-12-12 20:27   ` Stephen Leake
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox