Tech media devclass published a blog post yesterday (June 4), reporting that Apple’s internal team decided to use the more efficient programming language Swift because Java’s memory management method could not meet the growing demand and efficiency goals.
According to newly disclosed internal Apple documents, the reason why Apple’s development team was moving away from Java was a password monitoring service.
Citing a blog post, this key service developed by Apple mainly compares user passwords and leaked password lists, runs on Linux systems, uses multi-layer encryption technology, and processes “billions of requests” from around the world every day, which has an extremely high demand for computing resources.
Apple’s development team deprecated Java and rewrote key services in its own Swift
The service has relied on Java for many years, and while it has been widely recognized for its stability and performance, Java’s Garbage Collection (GC) mechanism has been frequently paused under high loads and has a high performance overhead, which has become a bottleneck for the team’s efficiency.
When looking for an alternative, the team chose Apple’s own Swift language and developed it with Vapor, an open-source web framework. Swift also has automatic memory management, but unlike Java’s GC mechanism, it is implemented through ARC (Automatic Reference Counting).
The team saw significant improvements in Swift: a 90% reduction in memory footprint, a 50% reduction in hardware usage, and a 40% increase in throughput. In addition, Swift code is cleaner and has nearly 85% less code, thanks to its emphasis on protocols rather than inheritance, support for asynchronous programming (async / await), and a type-safe design that avoids null checking.
Apple’s development team deprecated Java and rewrote key services in its own Swift
According to the team, Swift compiles to native code, does not require a Java Virtual Machine (JVM) or just-in-time compiler (JIT), has a shorter startup time, and is suitable for dynamically scaling hardware.
发表回复