Archive for October 30, 2016

Sunday, October 30, 2016

Whole-Module Optimization in Swift 3

Erik Eckstein:

Whole-module optimization is an optimization mode of the Swift compiler. The performance win of whole-module optimization heavily depends on the project, but it can be up to two or even five times.


Even the simple return statement in getElement needs a lookup in the type’s metadata to figure out how to copy the element. It could be a simple Int, but it could also be a larger type, even involving some reference counting operations. The compiler just doesn’t know.


Function specialization and inlining across files are just examples of optimizations the compiler is able to do with whole-module optimizations. Even if the compiler decides not to inline a function, it helps a lot if the compiler sees the implementation of the function. For example it can reason about its behavior regarding reference counting operations. With this knowledge the compiler is able to remove redundant reference counting operations around a function call.


The second important benefit of whole-module optimization is that the compiler can reason about all uses of non-public functions. Non-public functions can only be used within the module, so the compiler can be sure to see all references to such functions.

How Google Almost Killed ProtonMail

Andy Yen:

By the summer of 2015, ProtonMail passed half a million users and was the world’s most well known secure email service. ProtonMail was also ranking well in Google search at this time, on the first or second page of most queries including “encrypted email” and “secure email”. However, by the end of October 2015, the situation had changed dramatically, and ProtonMail was mysteriously no longer showing up for searches of our two main keywords.


In November 2015, we became aware of the problem and consulted a number of well known SEO experts. None of them could explain the issue, especially since ProtonMail has never used any blackhat SEO tactics, nor did we observe any used against us. Mysteriously, the issue was entirely limited to Google, as this anomaly was not seen on any other search engine.


In August, with no other options, we turned to Twitter to press our case. This time though, we finally got a response, thanks in large part to the hundreds of ProtonMail users who drew attention to the issue and made it impossible to ignore. After a few days, Google informed us that they had “fixed something” without providing further details. The results could be immediately seen.

Update (2016-11-12): See also: Hacker News.

Apple’s October TV Surprise

Joe Rosensteel:

Last year I argued that Apple was in no rush, and it wasn’t logical to lambast them for not including the feature. This year, however, as devices push more toward UHD, and HDR, the lack of any model in their lineup that supports it is slightly less excusable at the price point they’re in. […] The only company selling an HD-only streaming media device above $50 is Apple. The only company selling a steaming media device without HDR above $90 is Apple.


Apple announced tvOS 10 this summer, at WWDC and Eddy Cue made a big deal out of Single Sign On. Single Sign On would do away with one of the biggest pain points for cable-subscribers using Apple TVs by providing a one-time authorization. It was billed as part of tvOS 10, and tvOS 10 was billed as coming in September. It never shipped, but it remained at the top of Apple’s product page for the Apple TV until yesterday with a “Coming soon” button under it. No timeline whatsoever.


So Apple made the Fire TV home screen, as an app, except they couldn’t get Netflix onboard, while Amazon could.


There’s a total lack of understanding about TV in homes, which has plagued the product since it shipped last year, and seems guaranteed to persist another year.

Update (2016-11-02): See also: Hacker News.

Update (2016-11-05): Jared Newman:

The Apple TV’s lack of conviction isn’t just about words, it's about action. On that count, the upcoming TV guide will be a half-hearted solution for as long as Apple relegates it to a separate app, rather than making it a core element of the Apple TV interface.

HomeKit’s Stringent Security Requirements

Aaron Tilley (in 2015, via John Gruber):

Apple allows for either WiFi or Bluetooth low energy (LE)-enabled devices to get certified as a HomeKit accessory. Apple is requiring device makers using both WiFi and Bluetooth LE to use complicated encryption with 3072-bit keys, as well as the super secure Curve25519, which is an elliptic curve used for digital signatures and exchanging encrypted keys.


Another source who requested anonymity to protect his relationship with Apple said lag times reached 7 minutes when his company’s device tried to use the HomeKit protocol through Bluetooth LE. According to the source, chipmakers like Broadcom BRCM +% and Marvell are revamping their Bluetooth LE chips to better handle the level of encryption required by Apple.


All of this pain, however, could be a boon for the smart home industry, especially on the security side. The industry has had to contend with a reputation for lackluster security.

The Price of GPL

Matt Mullenweg:

If I were being charitable, I’d say, “The app’s editor is based on the WordPress mobile app’s editor.” If I were being honest, I’d say that Wix copied WordPress without attribution, credit, or following the license. The custom icons, the class names, even the bugs.


As this Hacker News comment put it, “Open source is not a swap meet; you can’t violate a license if you voluntarily release some other code to make up for it.”

Via Daniel Jalkut:

Many developers understand, and view the price of GPL as perfectly justified, while others (myself included) find it unacceptable. So what am I supposed to do? Not use any GPL source code at all in any of my proprietary products? Exactly. Because the price of GPL is too much for me, and I don’t steal source code.