# New code-golf metric : Efficiency*characters

So, I thought about a new metric of code-golf, the code with the smallest value wins. The value is calculated by characters*time to run. So if you use an programming language like python, it's very short, but for that reason, it's less efficient. This results in a chance for efficient programming languages, which take more chars. My question is :

How can we measure efficiency/time to run ? Everybody's got a different setup.

How could we call this new type of code-golf ?

• This is not good IMO as we are yet to come to a consensus for fastest-code. This is because timing will always be different on different setups. Plus, it's not hard to make a fast golflang so it's pretty much pointless anyway. – ASCII-only May 27 '17 at 11:00
• @ASCII-only : A efficient programming language needs to be strongly typed, what means more chars. – LMD May 27 '17 at 11:04
• It doesn't need to be, implicit typing exists, plus it can still be very fast even without strong typing – ASCII-only May 27 '17 at 11:04
• @ASCII-only : Probably we could measure efficiency using online-interpretors like Tutorialspoint offers ? – LMD May 27 '17 at 11:05
• Wait true, TryItOnline exists for PPCG – ASCII-only May 27 '17 at 11:06
• @ASCII-only : Where can I find it ? – LMD May 27 '17 at 11:41
• tio.run (execution time is in debug folder, or you can time from any shell) – ASCII-only May 27 '17 at 11:42
• Yes one metric can be (n characters) * O(algo). Because all algo has its big O number... the problem it is only to find the difference if O(f) == O(g)... Possible one can load and execute in Tio for see what is more fast? – RosLuP May 27 '17 at 14:06
• Plus Big O complexity is a number, plus that would be a different tag (the fastest-algorithm equivalent of this) – ASCII-only May 27 '17 at 22:55
• @ASCII-only The downside to TIO is that there's a 60-second time limit on execution. I'd imagine that most interesting tasks would take longer than 60 seconds on TIO. – Mego May 28 '17 at 3:22
• 60 second are enough because one can act on arguments of input make them smaller – RosLuP May 28 '17 at 12:53

What is the appropriate metric for a program? Yes there is the length of the program, there is the fast run, there is the error detection and secure and in range result, but first of all that, the more important of the first 3: There is the readability... I'm not agree with the ones see program as a min text to run(even if I like synthesis and in 90% cases have good results in synthetises), but either I not agree in see a program as a novel we have to read in English or in the language one is born. It is for me as read mathematical formulas, it is a language different from the one we usually speak (English, Danish, Italian, ...). If they want a better way for question and answer for me:

1) the question has always to speak and request the limits cases on answers (for to see if error way is ok for all (or almost all) input possible) 20% of the vote should be for this point, the error path

2) each variable name or operator name or function name, or type name ecc value is 1 character; the prototype of a function example "char g(char * v)" is 0 character each comment is -1 character 40% of the vote would comprehend this point, the code length

3) the fast code in one external machine for see the speed of the code 10% of vote would regard this aspect, the fast code

4) the vote of people (for readability and easy read and smart solutions) 30% of vote would regard this aspect, readability

• Yes, but this is code-golf. The question is:whose implementation is shortest, who has got the best algorithm. But how good an algo/its implementation is, has to be also measured on his efficiency. – LMD May 28 '17 at 17:26
• the best algo can be very long... – RosLuP May 28 '17 at 20:48
• Yes, but then it may be more efficient. – LMD May 29 '17 at 20:25
• If there is a problem of efficiency for me: Is more important the speed than the length of the code; if problem is not speed count more length of code and readability. I think that code return the right answer, and a good error path (for find errors) are important. And it is important too prefer always algo that has big O... little – RosLuP May 29 '17 at 21:27