Ask Slashdot: What's the Most Often-Run Piece of Code -- Ever?
Hugo Villeneuve writes "What piece of code, in a non-assembler format, has been run the most often, ever, on this planet? By 'most often,' I mean the highest number of executions, regardless of CPU type. For the code in question, let's set a lower limit of 3 consecutive lines. For example, is it:
- A UNIX kernel context switch?
- A SHA2 algorithm for Bitcoin mining on an ASIC?
- A scientific calculation running on a supercomputer?
- A 'for-loop' inside on an obscure microcontroller that runs on all GE appliance since the '60s?"
Every Ask Slashdot gets a comment pointing out that it's the dumbest Ask Slashdot ever, I know.
This time, it's really, really the case.
CLI paste? paste.pr0.tips!
Question: What piece of code, in a non-assembler format, has been run the most often, ever, on this planet? By 'most often,' I mean the highest number of executions, regardless of CPU type.
Answer: Genetic code.
How could this ever be more than a guess? How could it ever be determined, documented, or verified?
And for that matter, what is the definition of whether something is "the same" piece of code? For example, if the same source code compiles to different instructions on two platforms, are they running the same code?
How about if one of them actually compiles code that gets executed, and the other optimizes it out?
"How to Do Nothing," kids activities, back in print!
Assembly language is a high level language. It has macros and all sorts of constructs and stuff. I think the OP meant 'machine code.' If you've ever hand assembled machine code, or disassembled it from a hex dump, you know the difference.
eg. Call timer code in the 5ESS switch. Countless millions of times a day for over 30 years now. Probably the oldest code that we all depend on every day.
"To those who are overly cautious, everything is impossible. "
Well, all of those Windows reboots ought to bump the value up a fair bit.
Faster! Faster! Faster would be better!
Perhaps a pixel shader in a modern video game on console or PC, executed per pixel at HD resolution, and for hours (average play time) on tens of millions of machines?
Could be approaching 10^20 executions.
Lets approach this analytically.
What platform has the most computation power (number of CPUs x speed)?
Due to the increase in speed, we can disregard any CPUs built before 2000.
In number, mobile phones are the largest platform. So I would reckon, some GSM codec/cipher.
I think, for now, microcontrollers can be ignored, because they have much lower computational power.
Desktops and supercomputers have more power, but are they excessing the mobile phones? If they are a relevant portion, then across mobile phones and desktops, perhaps some code related to network access is the most-run.
I doubt it would be something kernel-related (like bootup, context-switching), because the kernel usually does not (or should not) take up a lot of the computing time. If we go by number of entries only, then perhaps some networking code.
If so, I'm not sure which layer to look into though. The lower ones are called more often, but media is not the same across use cases.
NB: The message above might reflect my opinion right now, but not necessarily tomorrow or next year.
that is actually... really fucking sad. So sad it made me laugh. Is that in itself sad?
Political debates have me rolling my eyes so much I think I got optical whiplash. I should sue. - Foamy The Squirrel
for almost all programs... written by people who have never heard of memset (or appropriate initializations for std::vector, etc.).
Perhaps it would be better to say for most genes that you compile a protein from the DNA using a temporary (RNA) copy and your ribosomes as the compiler, and the protein is the executable version ... although the ribosomal RNA genes are the most ancient still used and among the few that few active components that are still used in RNA form (tRNAs as carriers probably would not count).
Actually, it's likely not executed that many times - the CPU goes into HALT when idle, and wakes up when there's work to do. Gone are the days of endlessly spinning....
The Idle Process may be more book-keeping artifact than actual code.