Timeout on submit for last level on Hard APU (Haskell)


I have been trying for a moment to beat the last level of Hard Apu on Expert.
It has been a moment that my program passed all levels in the GUI for already but it failed on the Expert level whenever submitting.

At that time, my program was able to beat all levels on my computer in around 6s whenever it was launched with “runhaskell” (so not compiled).

At that moment, I guessed that it needed just some tweaking to pass the “submit expert test”. That’s what I did for more than a week, and now it passes all levels on my computer in less than 1.9s with the same settings (runhaskell, so no compilation).

With compilation without opti it runs in 0.160s beating all 13 levels in a row.
With compilation with O2 opti it runs in 0.090s (still beating all 13 levels in a row).

Has anyone validated this level in Haskell ?

Thanks in advance,

1 Like

I managed to rewrite everything and now I get a nice 100%

The performance gap between the two algorithms is not that huge though.

What I am measuring is the resolution of all 13 cases available in the level

  • Run the simplest test case to measure launch overhead : 0.7s
  • Old algo (runhaskell) : 1.9s meaning that it runs in 1.2s
  • new algo (runhaskell) : 1.1s meaning that it runs in 0.6s
  • Old aglo (compiled & measured with the profiler) : 0.15s
  • new aglo (compiled & measured with the profiler) : 0.07s

So there is a x2 factor between old algo and new algo.

I don’t know how the haskell code is executed on the server side of coding game, but I think that it is only run with runhaskell and not compiled, which is unfair given the fact that haskell is a compiled language such as C++.

Would it be possible to clarify how haskell code is run on CG side ?