3 ms·
True. C# and Java constantly beat Swift on speed.
by DeathArrow 7y ago
True. C# and Java constantly beat Swift on speed.
- etse 7y agoSorry about the naive question, but if the memory management overhead is worse in Swift, is the hardware it runs on typically better? I'm assuming some of this because I've noticed Android devices tend to require more CPU/memory compared to iOS devices in the same generation.
- ken 7y agohttps://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160208/009422.html https://lists.swift.org/pipermail/swift-evolution/Week-of-Mo... Lattner on Swift (2016): "...while it is true that modern GC's can provide high performance, they can only do that when they are granted much more memory than the process is actually using. Generally, unless you give the GC 3-4x more memory than is needed, you’ll get thrashing and incredibly poor performance..."
- aidenn0 7y agoAgreed. I would say 2x the heap size is table-stakes for high-performance tracing GC, and the more you give it the better performance you can get.
- flumpcakes 7y agoApparently the custom processors used in iOS devices are actually some of the fastest out there in that form factor. Designed by apple (I think using ARM instruction set) and made using some of the latest, most advanaced, process nodes by TMSC. If you look at raw benchmarks, they handidly beat the best Qualcom/"android SOC" chips out there. I think this changes very rapidly - given the market segment of high end phones has a yearly turn around. However, I did read an article today that claimed the "cheapest iPhone" (the new SE model) is faster than the most expensive android phone currently out there.
- saagarjha 7y ago> I think this changes very rapidly Apple has been leading the mobile processor market by quite a bit for the last five years.
- jayd16 7y agoThere are a lot of factors at play. Some technical like OS differences, and some non-technical like race to bottom spec pushing by Android OEMs.
- saagarjha 7y agoSwift is currently missing some optimizations that would allow for better knowledge of object lifetimes and potential elision of refcount updates.
- DeathArrow 7y agoBefore downvoting, please look at benchmarks. https://benchmarksgame-team.pages.debian.net/benchmarksgame/performance/regexredux.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/... https://benchmarksgame-team.pages.debian.net/benchmarksgame/performance/spectralnorm.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/... https://www.techempower.com/benchmarks/#section=data-r18&hw=ph&test=fortune&l=v2qirh-f https://www.techempower.com/benchmarks/#section=data-r18&hw=... https://github.com/frol/completely-unscientific-benchmarks https://github.com/frol/completely-unscientific-benchmarks