Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Android Facebook IT

Facebook Unveils Superpack, a New Compression Technique (fb.com) 54

An anonymous reader writes: Facebook unveiled a new compression technique they call 'Superpack compression.' In a blog post written by software engineer Sapan Bhatia, they claim that their compression improves Android app size by 20% over the default Zip compression used by Android. The post gives an overview of the compression ideas. The basis of these ideas is called out to be a key insight in Kolmogorov Complexity, that any data can be represented in the form of programs that generate that data. Facebook's tool, Superpack, mines out such small programs and optimizes them using compiler techniques.
This discussion has been archived. No new comments can be posted.

Facebook Unveils Superpack, a New Compression Technique

Comments Filter:
  • by nightflameauto ( 6607976 ) on Monday September 13, 2021 @04:39PM (#61793319)

    I would have never thought Richard would go work for Zuck. I mean, why not just go work for Gavin Belson again?

  • I am willing to believe that it improves the size.
  • by cheesybagel ( 670288 ) on Monday September 13, 2021 @04:45PM (#61793345)

    Hardly surprising you get improved compression with a domain specific compression algorithm.
    That was how WinRAR also gots its claim to fame, with different binary compression algorithms.

    • It's also not a particularly impressive to compare it against Zip, an old algorithm that has been surpassed years ago.

      • To be honest if you read the article proper they also compare it with XZ which probably means LZMA2 like the one in 7-zip.

      • by suutar ( 1860506 )

        Impressive, no, but a useful data point since zip is still in use in the app compression domain and easily available to compare other approaches against

        • by sb98052 ( 857171 )
          Yes, and a useful data point also because Android uses Zip/Deflate compression by default.
    • by AmiMoJo ( 196126 )

      It's quite a clever way of compressing machine/byte code though, an improvement over more traditional executable compressors.

  • by Thelasko ( 1196535 ) on Monday September 13, 2021 @04:52PM (#61793381) Journal
    I'm sure Facebook will make it free, as long as you let it send a copy of your data to their servers.
  • by omnichad ( 1198475 ) on Monday September 13, 2021 @05:05PM (#61793417) Homepage

    They could, you know, just develop a less bloated app.

    • To follow up, just look at Whatsapp on their chart. It seems that the apps originally developed in-house were far worse / required more compression while things they haven't meddled with for as long are a bit more lean. Instagram was sold to Facebook a couple years earlier, so they have a bit more bloat.

    • They could, you know, just develop a less bloated app.

      That is silly.

      Developing an app is expensive and time consuming.

      Improving the app to make it 20% smaller is even more expensive and time-consuming.

      Running a compression algorithm costs almost nothing.

      It is ridiculous to use hours of programmer time rather than seconds of machine time.

      • by sjames ( 1099 )

        Or they could employ more skillful developers who know when to do a minor re-factor. As a side benefit, the code becomes more maintainable.

        • This, so much this.

          Will be one of my new favourite questions when I hire someone, along with "how much weekly time do you usually devote to refactoring in a project you're developing from scratch"?

          Hint: anyone who hasn't realized that usually by Friday they've acquired a deeper understanding of the problem they were working on since Monday, warranting at least a partial refactoring, is not in the top 25% of their field.

        • I believe developer-skill follows a normal distribution (bell-curve); you should be able to buy less skillful developers for cheaper price. ie use lot of cheap labor and high-machine technology to improve profitability.
      • Re: (Score:3, Insightful)

        by PIC16F628 ( 1815754 )

        Bloated code is a problem for the end user - no other party. Apps gobble up space on the phone because of their size. Even downright simple small apps these days show their apk size in hundreds of MBs. The only reason I fathom is because of multi-device frameworks that are used for write-once, deploy on multiple devices. Why these frameworks don't discard unused code from their libraries at code generation time is beyond me.

        Imagine how sinful this whole thing is. For saving some time of a developer they are

      • by AmiMoJo ( 196126 )

        The compression only affects the download size though, not the amount of memory the app uses on your phone. So de-bloating it is a good idea too.

    • That strategy would, unfortunately, require some actual thought and skill.

      • That strategy would, unfortunately, require some actual thought and skill.

        Indeed. That is why optimizing toward the Kolmogorov Complexity is sometimes seen as the ultimate Turing Test.

        KC is proven to be noncomputable. There is no way to brute force it.

        But you don't have to believe me. You can click here to see it explained by an Australian chick [youtube.com].

        • Yes, the ultimate Turing Test...of programmers!

          Better programmers invariably write far fewer lines of code than worse programmers. And those fewer lines will invariable do more, with greater accuracy, than the more lines of code written with less skill.

          Concise code is indeed one of the best measures of a talented programmer.

    • I'm afraid that the developers of tbe Facecrap app will see the reduced size, and just use it as an excuse to bloat it up even further, with the added overhead of real time decompression.

      Also, there is no fucking excuse for this to not be removable on non rooted phones. This is robbing the device owner of the memory he or she paid for.

    • We did. It's called not Facebook!

      Just uninstall Facebook. There's only morons left there nowadays anyway. All it does, it make your life worse.

    • That won't align with the goal of "maximum employment".
  • Is this middle out?
  • This is code size only.

    You're telling me they've spent several man-years figuring out how to compress their code so that initial download and install takes less time?

    Isn't the real problem with these apps that they pull video and autoplay it all day long to a bunch of digital junkies? The quantity of data pulled over the lifetime of the app is many thousand times larger than the app itself.

    I got an idea, I could improve the code size by 100% if I just remove it from the phone entirely.

    • Isn't the real problem with these apps that they pull video

      Optimizations based on Kolmogorov complexity can work with video too.

  • by ewhac ( 5844 ) on Monday September 13, 2021 @05:46PM (#61793535) Homepage Journal

    The basis of these ideas is called out to be a key insight in Kolmogorov Complexity, that any data can be represented in the form of programs that generate that data. Facebook's tool, Superpack, mines out such small programs and optimizes them using compiler techniques.

    Is this a fixed corpus of code snippets selected by tokens in the data stream? Or is the "compressed" data stream actually a pile of tiny subroutines I'm expected to execute to reconstruct the data?

    Because if the latter, there is absolutely no fscking way I'm touching this. "Oh, it'll be sandboxed!" Fsck you; that's what you nincompoops said about Java and JavaScript and ActionScript and MSWord macros, to name but a very few.

    • Since you didn't say "Don't get me started on CPU hardware vulnerabilities." Might I get you started on CPU hardware vulnerabilities?

    • by Anonymous Coward
      > Or is the "compressed" data stream actually a pile of tiny subroutines I'm expected to execute to reconstruct the data? Depends on what you mean by "execute." Most compressed representations can be compared to bytecode in that some bits constitute instructions for how subsequent bits are to be decoded. These instructions could be "look at the match register" and repeat it, but with length X. Or "copy N bytes from offset P." Seems like this compression uses a more elaborate instruction set. There's no
  • From the blog post: "We may someday consider open sourcing Superpack."

    Too bad, i had good luck using zstd (https://github.com/facebook/zstd) on binary data. Since this leverages zstd, was hoping even better compression.

    • I wish they could have Superpack as part of zstd, because zstd is extremely useful. I mainly wind up using both with Borg Backup (a good deduplicating backup program), as well as btrfs (which is another thing Facebook has tamed and improved on.) Both have been quite useful in day to day use.

      FB's bad stuff aside, these F/OSS contributions are quite useful in day to day use. It would be nice if they could come out with something that beat "xz -v9e" for compression, because often, there is plenty of CPU ava

  • Great. Once you do, assuming it's not patent-encumbered, maybe someone else will consider using it too.

    And then maybe you won't have problems like this:

    Since the diffing process implemented in the current tooling is not able to interpret Superpack archives, the deltas come out to be larger for apps containing such archives.

  • But this only shrinks the APK size, not the app. The app is still decompressed on the device and takes up as much space as it wants, regardless of how the APK is created.

    • Yes, and? Every picture on a website has to reside uncompressed in RAM aswell.

      People always wonder why web sites take so much memory. Have you ever tried decompressing all the shit on a modern site? 1GB only gives you a square 16k image in 8-bit RGBA!

  • Just look at the Facebots' brains with an x-ray machine.

  • by Guru2Newbie ( 536637 ) on Monday September 13, 2021 @11:48PM (#61794401) Homepage
    Facebook Unveils Superpac, a New Oppression Technique
  • 20% more than zip isn't exactly a high bar.

    RAR and xz have been doing that for more than a decade.

  • except literally anybody else could have lowered their app size by more than 20% by removing absolute bullshit included within it, and refactoring their ui to actually be sane.

If you have a procedure with 10 parameters, you probably missed some.

Working...