Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

23
  • 6
    \$\begingroup\$ Just to note, Dennis has said in the past that TIO is not a good timing method for fastest-code challenges, which presumably would be applicable to other online interpreters. It might be best for you to test all submissions on your machine, requiring people to include testing instructions. \$\endgroup\$ Commented Nov 11, 2020 at 16:26
  • 4
    \$\begingroup\$ I think you need more or bigger test cases. With Python 3.8's math.isqrt, the actual computation seems to take little time relative to that for input/output. \$\endgroup\$ Commented Nov 11, 2020 at 20:34
  • 7
    \$\begingroup\$ This is a very important question: What parts are required to be in the time: the actual maths, the outputting (print/console.log/System.out.println/prinf/etc.), the setup (reading from a file/initializing an array? I would assume only the maths AND the outputting should be included in the timing, but we need to know for sure to stay consistent for everyone. \$\endgroup\$ Commented Nov 11, 2020 at 23:11
  • 3
    \$\begingroup\$ I also think this needs larger testcases. Currently I/O takes more time than the actual square root. Test cases on the order of \$2^{10^4}\$ to \$2^{10^5}\$ should do. \$\endgroup\$ Commented Nov 12, 2020 at 0:45
  • 4
    \$\begingroup\$ Can I suggest a more scalable benchmarking strategy? Describe an infinite sequence of squares of exponentially increasing length, using some simple deterministic algorithm with a seed provided as input. Your score is the number of these square roots you can take in 10 seconds. \$\endgroup\$ Commented Nov 12, 2020 at 20:44