4 ms·
The rule lawyer in me wants to spend the first run spinning up a background daemon that loads everything into memory, pins it there, and maybe even prefetches e
by e63f67dd-065b 3y ago
The rule lawyer in me wants to spend the first run spinning up a background daemon that loads everything into memory, pins it there, and maybe even prefetches everything into cache as the subsequent runs perform basically a linear scan (you never have to pagemiss if you have an oracle!).
> write a Java program for retrieving temperature measurement values from a text file and calculating the min, mean, and max temperature per weather station
Depending on how far you want to stretch it, doesn’t precomputing the result on 1st run count too? Or pre-parsing the numbers into a compact format you can just slurp directly into rolling sums for subsequent runs.
Not the slightest in the spirit of the competition, but not against the rules as far as I can tell.
Edit: if we don't like pre-computation, we can still play with fancy out-of-the-box tricks like pre-sorting the input, pre-parsing, compacting, aligning everything, etc.
Edit 2: while we're here, why not just patch the calculate_time script to return 0 seconds :) And return 9999 for competitors, for good measure
- yellow_lead 3y agoI think that would violate this rule > The computation must happen at application runtime, i.e. you cannot process the measurements file at build time (for instance, when using GraalVM) and just bake the result into the binary
- e63f67dd-065b 3y agoAh I didn't actually follow the link to the github repo. I don't think that percludes pre-processing the input into something that needs no parsing, however, or to spawn a background daemon that prefetches everything in the right order. The first run is indeed runtime, not build time, so technically I think I still count with pre-computation, sending that to the daemon (or just stashing it somewhere in /tmp, or even crazier patching the jarfile), and just printing it back out on the second run onwards.
- robertlagrant 3y ago> I don't think that percludes pre-processing the input into something that needs no parsing Why not preprocess it into a file that contains the answer? (-: My read of the description was just: you're meant to read the file as part of the run.
- gunnarmorling 3y agoYeah, and I'd count caching results between runs into the same category, i.e. against the spirit of this challenge. Folks should keep in mind that the goal is to learn something new, rather than "winning" by cheating the rules.
- cm2187 3y agoThough the caching done by the OS (I/O for instance) is fair game
- gunnarmorling 3y agoYes, exactly. Retrieving the source data file from the page cache != storing and reloading precomputed results.
- camkego 3y agoThere is a real issue with providing the contestant the real exact file that will be used in the contest. Because there are 1e9 shades of gray between hard coding the correct answer in a single line program which doesn't even read the input, and processing the file as if we don't know what it contains. This might become a contest of judging what is fair pre-computing and what is not. That's why machine learning contests don't let participants see the final data.
- londons_explore 3y agoFix: A run consists of: * I generate random measurements with the provided script, which will be stored in a readonly file. * I run your program to calculate the results (and time it). * I run my baseline program and your entry is valid if my baseline program calculates the same results.
- lelanthran 3y agoThe filesystem has to be read-only as well, otherwise the first run can simply write the results to ~/.me_cheater and the program first reads that file before attempting to read the dataset.
- rocqua 3y agoI think the rules should stipulate each run is on its own tmpfs and all processes and pagecaches are cleared between runs.