Post Reply 
[VA] SRC #016 - Pi Day 2024 Special
03-17-2024, 08:59 PM
Post: #17
RE: [VA] SRC #016 - Pi Day 2024 Special
(03-17-2024 05:38 PM)DavidM Wrote:  
(03-16-2024 03:58 PM)Gerson W. Barbosa Wrote:  P.S.: It took about one and a half hour, but I’ve finally obtained the results. Some optimizations are definitely required.

When I saw "for N=10, 100, 1000, ..., one million tries", I knew right away that I wasn't going to attempt a straight User RPL solution, mainly because I knew that it was highly unlikely to perform well enough to provide a result before I lost patience with the exercise. Even an empty (User) RPL loop of 1 million iterations takes about 21 minutes on an actual 50g. Start adding code to the loop, and the execution time grows substantially.



Time: 46.3s (Emu48 on desktop computer)
xxxxxs (real 50g) (to be filled in after current run completes, estimate: 3.25 hours)

That ran together with other concurrent tasks on my smartphone. In order to be fair, I repeated the run after disabling automatic screen lock and making sure the emulator was the only application running until completion. Now it took 1755.7s, barely half an hour. My second program elsewhere in this thread, running under the same conditions, took 841.6s, that is, less than 15 minutes. On the first program the counter was reset at the beginning of each decade; on the second program it was reset only in the beginning of the program, so past decade data could be used cumulatively on the next ones. This implied in about 11.11% speedup. Some additional 35% with obtained just by the use of CEIL, like C. Ret did, instead of INT with additional arguments. Another 3 or 4 percent were obtained by avoiding IF as in Juan’s program. The list processing of the pair of random numbers would take a little longer, according to my tests, so I let that behind. Overall about 50% faster than my first program, nothing that compares to your 18+ speedup when compared to my optimized program, though. Well done!

Gerson.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [VA] SRC #016 - Pi Day 2024 Special - Gerson W. Barbosa - 03-17-2024 08:59 PM



User(s) browsing this thread: 1 Guest(s)