4
\$\begingroup\$

Is there any winning criteria on the site which prioritises faster code instead of shorter code? My curiosity comes from questioning if size is better than efficiency or vice-versa. I know that using different computers to time different submissions can be difficult to objectively and fairly compare answers, but is it possible to use something like Try it online! (which includes execution times) instead?

\$\endgroup\$
1

1 Answer 1

4
\$\begingroup\$

/

challenges are, as the tag suggests, about creating the code to complete a task as fast as possible. Challenges with this tag should include the specifications of the machine being used to time the submissions (typically the challenge author's machine).

challenges are about the asymptotic time complexity of the answers, where the answer with the smallest such is the winner.

Note that both of these challenges should generally involve "tricky" tasks, as the margin of error for trivial tasks often overshadows the time taken to do that task itself (e.g. "add 2 numbers" would not be a good challenge)

Additionally, while it is tempting to use TIO to time answers, it generally isn't a good idea. TIO uses multiple arena servers, which don't all run at the same speed, and your timing can be affected by other users running code at the same time

\$\endgroup\$
2
  • 1
    \$\begingroup\$ very helpful, thank you! \$\endgroup\$
    – Figaro
    May 22, 2021 at 17:24
  • 1
    \$\begingroup\$ @MartinPrado If my answer answers your question, feel free to click the green checkmark underneath to accept it :) \$\endgroup\$ May 22, 2021 at 17:28

Not the answer you're looking for? Browse other questions tagged .