7 ms·
Challenge: Put all of Shakespeare's works into the smallest HTML file you can
- dunkmaster 9y agoEasy 0 byte compressed solution: just put the entire output in the decompressor and print it. This doesn't seem to be against the stated rules.
- dunkmaster 9y agoOops, after reading again I realized the decompressor size is included in the solution size metric
- niij 9y agoYou sound like my old CS classmates ;)
- Shoop 9y agoJust put all of the text in the file names.
- userbinator 9y agoI'm guessing whoever manages to implement a subset of https://en.wikipedia.org/wiki/PAQ https://en.wikipedia.org/wiki/PAQ in JS is probably going to win. Of course, the decompressor itself also needs to be compressed, which I suspect will be where most of the competition will happen.
- scrumper 9y ago> I'm guessing whoever manages to implement a subset of https://en.wikipedia.org/wiki/PAQ https://en.wikipedia.org/wiki/PAQ in JS is probably going to win. I'm not so sure; PAQ is pretty slow and the challenge has a 30m time limit. Check out the 1GB text compression benchmark in the wiki - it's orders of magnitude slower than the next best algorithm for a 5% improvement, and the benchmark case is basically the same as this challenge. Edit: I mean, it took 17 hours.
- aaronblohowiak 9y agoi believe the time limit is only for decompression!
- scrumper 9y agoI think you are right - great catch.
- userbinator 9y agoAccording to http://prize.hutter1.net/#history http://prize.hutter1.net/#history the current winner (which has stood since 2009) took 9h on a 2GHz P4 to decompress its input to 100MB, or roughly 3082 bytes/s. 30 minutes to decompress 5324821B is only slightly less, at 2958 bytes/s. This "on a modern computer", certainly not one from 15 years ago, even after factoring in JS overhead, sounds doable, if not easy. Have CPUs gotten more than an order of magnitude faster since then? Probably (but perhaps not for the type of code that would be encountered in a decompressor --- the biggest boost has been for vector operations, which are neither particularly suitable for high compression algorithms nor easily usable from JS.) Is JS overhead less than 10x native code? Probably for some cases too. In fact, I just tried paq8hp12 on the file and it compressed it to 1059027 bytes in 208 seconds on a moderately old system (i7 870). Decompression took the same time.
- xem 9y ago1059027 bytes for the Shakespeare file? that's impressive. I tried something called "PAQ*" compression but it generated a file that was nearly 2MB...
- newman8r 9y agoanother good challenge would to be trying to display them in the most interesting way possible in under x bytes, demoscene style. But I suppose that's a different audience.
- xem 9y agoplease develop, I'm actually interested by this kind of challenges too! :) What's your idea? like, asking people to output as much text as they can in 512kb or 1mb?
- xem 9y agoHi! I created that challenge but didn't see this HN page until now :) That's where all this traffic comes from! If you think 30 min is too short for decompression, I can change that rule. Just let me know.