Post Reply 
(EL-5120) N-Queens Benchmark
02-25-2022, 12:35 AM
Post: #5
RE: (EL-5120) N-Queens Benchmark
Interestingly, the difference is much slimmer on the EL-9300C. I'm using all global variables in the program since those are faster than local/lowercase variables in my tests. The chopping-block program found a solution in 4m40s, vs. the 4m38s for the matrix-based version in Article 700 (both tested on the same unit).

I'm not surprised that it's so much slower on the Casio, since Casio's indirect addressing is a lot like in RPN calculators, where you're just giving it an offset from the fixed start of variable memory. This is very efficient, since there's not really any lookup involved - A[0] points to A, A[1] points to B, and so on, and the variables always start at the same address.

However, in calculators like the EL-9300C where you can allocate matrices or lists that potentially end up sitting anywhere in memory, I assume the calculator first has to consult some variable catalog to find the starting address each time the object is referenced, and then use the subscripts to calculate an offset from that address. This extra lookup perhaps diminishes the advantage of using an array to store the individual digits. I'll have to test this on a TI and see how it behaves there. On their graphing calculators, the numeric variables are not fixed in memory like I assume they are on the Sharp (which provides no way to delete them, and doesn't report them in the memory check screen). The list/matrix version may again have a considerable advantage if both algorithms require variable address lookups anyway. It could be the same for later Casios that dropped the array memories and switched to lists and matrices.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (EL-5120) N-Queens Benchmark - xerxes - 02-24-2022, 10:05 PM
RE: (EL-5120) N-Queens Benchmark - Dave Britten - 02-25-2022 12:35 AM
RE: (EL-5120) N-Queens Benchmark - xerxes - 02-26-2022, 03:22 PM



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