13 報

Share this post

開發者週報 #68 M1 比你還冷靜

www.ethanhuang13.com

開發者週報 #68 M1 比你還冷靜

Apple/iOS 開發者的一週大小事 2020/11/23-2020/11/29

13
Nov 29, 2020
1
Share this post

開發者週報 #68 M1 比你還冷靜

www.ethanhuang13.com

13的話

這週沒有什麼開發者新聞,所以就拿台灣還買不到的 M1 繼續轟炸各位。

(看前一期 · 回首頁)


🍴What went wrong with the libdispatch. A tale of caution for the future of concurrency

本文是 libdispatch efficiency tips 這份經典指南同一位作者最近發表的文章。他提到在 GCD 剛發表的時代,電腦 CPU 在時脈上已經難有突破,開始往多核心發展。Apple 告訴開發者,透過 GCD,thread 可以盡量開。而作者因為這樣而踏入了多執行緒的踩坑經驗。

後來 Apple 也發現他們自己也落入了許多濫用多執行緒的陷阱。包括 iOS 12 效能提升一個原因是把 daemon 的多執行緒改成單執行緒。

Twitter avatar for @Catfish_Man
David Smith @Catfish_Man
@mxcl @peres What I’m getting at is that we’ve been discovering that the inherent costs of multithreading are a lot higher than they look in microbenchmarks (because microbenches hide cache effects and keep thread pools hot). A lot of iOS 12 perf wins were from daemons going single-threaded.
10:07 PM ∙ Jan 5, 2019
74Likes27Retweets
Twitter avatar for @Catfish_Man
David Smith @Catfish_Man
btw on the subject of “should I use NSOperationQueue or libdispatch”, since it came up, my concrete recommendation is: you should really strongly consider not writing async/concurrent code. I know this sounds weird in 2018, but the cost in complexity *and* performance is high.
4:02 PM ∙ Jan 5, 2019
186Likes35Retweets

之後 GCD 也隨著 iPhone 的推出來到 iOS 上。雖然它的語法簡單好用,相對地就不容易防止濫用。因此我覺得複習一下作者的建議(libdispatch efficiency tips)滿好的。

同場加映 libdispatch 的設計者出來講講話

Twitter avatar for @davezarzycki
David Zarzycki @davezarzycki
1/n As the designer of libdispatch, I just want to say: I get why people feel this way and I'm sorry that we/I oversold libdispatch to some degree at the time. (And just to be clear, I left Apple many years ago and I still deeply respect them.)
Twitter avatar for @tclementdev
Thomas @tclementdev
Here's my longer take on what went wrong with the libdispatch. A tale of caution for the future of concurrency. https://t.co/EscgiZjM9A
6:58 PM ∙ Nov 27, 2020
326Likes66Retweets

下一步呢?Swift 的 concurrent 吧

🔥更多的 M1 心得

首先,Peter Steinberger 的這篇文章很值得一讀,因為他的背景是做 SDK,各種 mobile 相關的情境都會遇到。包括 iOS、Android、Docker、虛擬化、各種開發工具等等。

連續推文,分析為何 M1 跑 Rosetta 也跑得很快(提示:Apple 作弊啊)

Twitter avatar for @ErrataRob
Robᵉʳᵗ Graham😷, provocateur @ErrataRob
1/ In case you were wondering: Apple's replacement for Intel processors turns out to work really, really well. Some otherwise skeptical techies are calling it "black magic". It runs Intel code extraordinarily well.
11:03 PM ∙ Nov 25, 2020
2,478Likes858Retweets

拿來跑 Minecraft

Twitter avatar for @marcoarment
Marco Arment @marcoarment
Can confirm: I spent a lot of time playing Minecraft (Java ed.) on my M1 MacBook Air over the last few days, and it runs shockingly well in absolute terms — not even grading on a curve to account for Rosetta — in complete silence, with great battery life, only getting a bit warm.
Twitter avatar for @LukeMiani
Luke Miani @LukeMiani
Quick Minecraft test... even the MacBook Air running at 10 watts, without a fan, through a translation layer, is running 60fps at native res without getting warm at all. Apple Silicon is nuts lol https://t.co/qpBjCBMv4l
6:06 PM ∙ Nov 22, 2020
610Likes56Retweets

Best Computer

Twitter avatar for @AlexMartinFR
Alex Martin @AlexMartinFR
@marcoarment I've been using an 8 GB Air for a few days and I already want to make it my main machine, that's how freaking good it is 😎 Silence, performances, battery life; everything I value in computing, this beast provide. Behold, the New Best Laptop Ever Made™ has arrived! 🎉
6:45 PM ∙ Nov 22, 2020
Twitter avatar for @Janne_o
Janne Ojaniemi @Janne_o
@marcoarment I bought the baseline MBA last Friday. I think this is the best and most impressive computer I have used in a long time. I don't miss my 2015 5K iMac with 32GB of RAM at all. This doesn't get hot, no slowdowns, ever. And battery seems to have no end.
8:32 PM ∙ Nov 22, 2020

快速切螢幕

Twitter avatar for @__syumai
syumai @__syumai
M1 MacBook Airのディスプレイ切り替えが速すぎると言う噂、本当だった
Image
2:49 AM ∙ Nov 23, 2020
2,235Likes455Retweets

DHH 評論

Twitter avatar for @dhh
DHH @dhh
Apple M1.
Image
3:53 PM ∙ Nov 23, 2020
281Likes37Retweets
Twitter avatar for @dhh
DHH @dhh
You don't sit around thinking "oh, browsing the web is slow on my decked-out iMac", but then you browse with the M1, and you're like, DAMN, I can actually feel that +50%. 224 on Speedometer 2.0 is just 🤯
3:56 PM ∙ Nov 23, 2020
151Likes10Retweets

回不去了

Twitter avatar for @marcoarment
Marco Arment @marcoarment
Got back to my iMac Pro for the first time in 2 weeks… Why does it build Overcast slower than my new MacBook Air, and what’s this annoying whooshing sound it makes whenever I ask it to do anything useful? (god, I’m ruined)
4:30 PM ∙ Nov 23, 2020
1,643Likes93Retweets

續航力

Twitter avatar for @jdalrymple
Jim Dalrymple @jdalrymple
Been using the M1 MBA for the past two hours off and on for normal work stuff. Battery is still at 97%.
6:20 PM ∙ Nov 23, 2020
62Likes2Retweets
Twitter avatar for @twolivesleft
Simeon @twolivesleft
M1 Xcode Benchmarks for Codea and Shade
Image
12:08 PM ∙ Nov 26, 2020
287Likes39Retweets

效能比較

Twitter avatar for @robertjpayne
Robert Payne @robertjpayne
Can confirm our large Swift/C project archives about 1.6x faster on an 13” M1 MBP than a fully decked out 2017 5k iMac. The next chips Apple releases for more powerful machines are gonna be absolutely bonkers.
7:56 PM ∙ Nov 23, 2020
3Likes1Retweet
Twitter avatar for @johnsundell
John Sundell @johnsundell
With M1, I can run Plot's entire test suite (which contains 146 tests) in less than 0,05 seconds! 🤯 At this point, I could almost auto-run all of the tests every time that I change a single character within my code base - now that would be true TDD 😂
Image
8:13 PM ∙ Nov 23, 2020
526Likes32Retweets
Twitter avatar for @bendodson
Ben Dodson @bendodson
This M1 chip is obscene. Only played with it for a brief time but it's a game changer for iOS developers. Compared to my Mac Pro (3 GHz 8-Core Intel Xeon E5, 32GB RAM) it does incremental builds 5x faster and archives 2x faster with half the RAM, less power, and no heat.
6:36 PM ∙ Nov 24, 2020
9Likes1Retweet
Twitter avatar for @merowing_
Krzysztof Zabłocki @merowing_
my i9-9900k hackintosh with 32 GB ram is at 156 s compile time vs M1 16GB is at 116, I can’t wait for 16’ rMBP / iMac with more powerful processors :)
3:55 PM ∙ Nov 25, 2020
83Likes8Retweets
Twitter avatar for @sandofsky
Ben Sandofsky @sandofsky
We can now build Halide and its only dependency, OpenSSL, on M1 Macs. Going from a 2019 16” MacBook Pro (32GB RAM) to an M1 Mac Mini (16GB), the gains are ridiculous. OpenSSL: 10m32s => 5m24s Halide: 0m49s => 0m28s
10:52 PM ∙ Nov 25, 2020
578Likes66Retweets
Twitter avatar for @steipete
Peter Steinberger @steipete
I took the time to compare clean compile times (debug, our example catalog app for arm64 iOS) MacBook Pro 16-inch 2019 2,4 GHz 8-Core i9 32 GB (fans as loud as it gets): 7:31 min MacBook Air M1 (already warm from doing stuff before, completely silent): 8:49 min Impressive.
8:02 PM ∙ Nov 26, 2020
132Likes2Retweets

坑:App Store 下載的 iOS App 會把機器認成 iPad Pro

Twitter avatar for @marcoarment
Marco Arment @marcoarment
iOS devs, FYI: unmodified iOS apps running on M1 Macs appear to report themselves via hw.machine as model identifier “iPad8,6” (iPad Pro 12.9-inch, 3rd-gen, 1TB model). So if you see a very recent spike in your analytics in iPad 12.9 users, that’s probably why.
9:44 PM ∙ Nov 23, 2020
849Likes116Retweets

這下全錯了😂

Twitter avatar for @Blankwonder
Yachen Liu @Blankwonder
上周五去朋友公司做客,和他们行政聊天: 她:X 总看到你朋友圈把新的 MacBook Pro 夸上天了,立刻就让我去给他采购了台。 我:他可真够急的。 她:是啊,我找 Apple 的商务立刻就给他下单了,顶配 32G 内存的。 我:……
3:06 AM ∙ Nov 25, 2020
164Likes8Retweets

🕸Local Network Privacy FAQ

有在處理區網跟隱私的話,這是 Apple 官方整理的問答。比如「我要怎麼發起 iOS 14 的區網權限要求對話框?」(感謝 @KoromikoNeo 轉推)

⛏Comparing iPhone OS 1.0 with iOS 14 using tree maps

iPhoneOS 考古學。看看從 1.0 到 14 差了多少?

🏃第 12 屆 iT邦幫忙鐵人賽得獎作品

之前我貼過,但這次是得獎名單。跟 iOS 有關的:

  • RxSwift / 30天探索之旅—Bing

  • 看完眼眶濕濕的App開發者慘烈對抗險惡資安環境血與淚的控訴!—羊小咩

  • 30 天從 Swift 學會 Objective-C—ytyubox

💍另類承諾

Twitter avatar for @Casey
Casey Neistat @Casey
wife and I don’t wear wedding rings, we show our commitment to one another by exchanging sim trays in our iPhones.
Image
Image
5:31 PM ∙ Nov 24, 2020
235,326Likes20,540Retweets

以上就是本期的內容。歡迎轉寄或推薦給同事或開發者朋友。有問題或回饋請直接回覆,或到我的 Twitter 留言。

Share this post

開發者週報 #68 M1 比你還冷靜

www.ethanhuang13.com
Comments
TopNewCommunity

No posts

Ready for more?

© 2023 ethanhuang13
Privacy ∙ Terms ∙ Collection notice
Start WritingGet the app
Substack is the home for great writing