Advent of Code 2024 Day 6 (BaseA Style)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Discussion thread for day 6 of the Advent of Code - https://adventofcode.com/2024/day/6
- Labels:
- Advent of Code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@SeanAdams As I've been interested in the performance of AMP, thank you for sharing this toping.
When it comes to Iterative Macro, handover of iteration record from previous to next iteration should be one of the factor of slow running time, I suppose. As a first step, I investigated the running time of Day6P1 under the several conditions. I will figure out why running speed varies and what's going on with help of ProcMon (I installed ProcMon in my computer just now. Thank you for introducing it.).
Engine |
1 process in Macro (164 iterations) |
2 process in series in Macro (82 iterations) |
3 process in series in Macro (54 iterations) |
Non-AMP | 2.1 sec | 2.0 sec | 2.0 sec |
AMP | 3.2 sec | 2.2 sec | 2.0 sec |
AMP w/ compatibility mode | 3.2 sec | 2.2 sec | 2.0 sec |
Terminology:
'2 process in series in Macro' is to arrange the same process in series to reduce the necessary iteration number into half.
Likewise, '3 process in series in Macro' is like this. The necessary iteration number is one-third.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
After many different approaches and endless looping (a specialty of mine), I finally got Part 1 to run in 22.5 seconds.
Somewhere in the back of my mind, Digan was reminding me to minimize what I actually send through the iterative macro, so only sent the next location of the guard after moving (while outputting all of the steps taken in that movement)
More on this later. On to read Part 2.....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Finally...
But it is good to see the iterative macro runs in shorter time as the iteration goes on :)
Now it runs in 14:04 minutes for Part 1 & 2 combined.

- « Previous
- Next »