Ad
  • Custom User Avatar

    Anyway, I have now slimmed down the test_wild_monkey test a bit.

    I already have updated the tests, so they will (hopefully) not time out. As I already mentioned the test_wild_monkey function
    calls send and receive pretty often with pretty big loads of data, so it is no wonder that it is slow.

    Why should I care about that now? The part about performance (minimizing data transmitted) is a bonus section

    The bonus section is about the transmitted data size, not the code performance. Very slow code will time out and this has nothing to do with the task.
    But I realize that my tests have exaggerated a bit.

  • Custom User Avatar

    You could still save quite a bit of time by saving up some allocations.

    Why should I care about that now? The part about performance (minimizing data transmitted) is a bonus section, so it's not mandatory. My solution is still O(n), albert with a large constant factor because I was writing the simplest possible solution. Still, 10^6 is a perfectly reasonable size, and there are no reasons something that should operate in O(n) times out at 10^6.

    I'm not sure what you mean by "can't handle". Do you mean that it is extremely slow or that it is not doing its job properly?

    Let me repeat this again: The time out comes from your wild monkey function. My functions can process the same data very quickly. You need to look at why your function is so slow.

  • Custom User Avatar

    I just found that I can look at your solution. You could still save quite a bit of time by saving up some allocations.
    I'm not sure what you mean by "can't handle". Do you mean that it is extremely slow or that it is not doing its job properly?
    And is the 10⁶ bytes the length of the return vector of asend call by test_wild_monkey?
    Anyway, I have now slimmed down the test_wild_monkey test a bit.

  • Custom User Avatar

    Your question doesn't even make any sense... I already pointed out your wild monkey function can't handle 10^6 bytes or more reliably, which you can easily verify. Your code needs to be O(n).

  • Custom User Avatar

    the wild monkey function performs some load tests, including tests with rather large input vectors.
    Could it be that you are outputting a vector that has a size of O(n^2) relative to the input vector, or even larger?
    That would explain the timeout for me.

  • Custom User Avatar

    It'd appear that your wild monkey function might actually be kinda slow and can't handle anything more than 10^6 bytes.

  • Custom User Avatar
  • Custom User Avatar

    This is my first kata so I don't have any knowledge about the test system.
    The timeout is not reproducible for me. Do the tests run on client side?

  • Custom User Avatar

    Oh, yeah, thanks, this will be a quick fix sweatsmile

  • Custom User Avatar

    tests::test_wild_monkey seems to always time out.

  • Custom User Avatar

    Failing the sample test do not generate failed test assertions, so they still display as success.

  • Custom User Avatar

    You can't, but you can infer it based on the number of mines.
    Let's take a test case where you have 6 mines.
    If you solve the puzzle and use your second solution and
    get minimum 7 mines, your second solution is impossible.
    In your reply, this exactly is the case!