m_b_metcalf wrote:champagne wrote:As shown by mladen dobrichev, fss2 solves the hardest puzzles in about 100 microseconds, and the easy ones about 1000 times faster
So it reads an easy puzzle, solves it, and writes it to file with just a few hundred machine instructions being executed. Or do I misunderstand?
Regards,
Mike
Decades ago, computer processors were rated in MIPS (Million Instruction Per Second) but for an assortment of reasons, manufacturers have switched to rating processors in Giga Hertz. As I understand it, there is no simple conversion from GHz to Instructions per second. Different instructions take different numbers of cycles.
To add to the confusion, another method of rating speed uses FLOPS Floating point Operations Per Second. The floating point operations can be the limiting factor in many kinds of computation problems, but they are not the only type of operations that make up a complete program.
In any event, '...just a few hundred machine instructions...' is a far too small number. And because all modern general purpose computer operating systems support both virtual memory and multi-tasking, even running the exact same sequence of source program instructions over and over would not be likely to translate to anything like the same number of machine instructions with an accuracy 'a few hundred instructions.'
As an example, a simple page fault could easily cost a few hundred machine instructions and a single running program does not begin to determine how many of its pages get invalidated. That depends more on what else is happening and how much free memory is installed. There always LOTS of other things happening.
I would think any serious attempt to count instructions would, itself, seriously distort the results. Running something 100,000 times and averaging the results may be as good as can be gotten. It might be interesting to collect those times separately to look at the variance, but even that might be impractical or impossible. Maybe running it 1,000 times for a time count and repeating that 100 times for a sample. Then calculate the variance. I've never tried anything like that.