news.volyx.in

Improving Firefox Responsiveness on macOS (hacks.mozilla.org)

780 points by Amorymeltzer · 1429 days ago · 374 comments on HN

Article summary

The article discusses how Firefox's responsiveness on macOS was improved by changing the locking mechanism in its memory allocator. The old locking mechanism, OSSpinLock, was deprecated and replaced with os_unfair_lock, but the new lock had performance issues. The author found an undocumented flag, OS_UNFAIR_LOCK_ADAPTIVE_SPIN, which improved performance, especially on loaded systems. This change was made to improve Firefox's responsiveness, especially when running multiple tabs or other applications.

Main themes

  • Firefox performance on macOS
  • locking mechanisms
  • app stores and distribution
  • iOS browser performance
  • high-performance locking
  • CPU architecture and optimization
  • memory allocation and contention
  • app store security and curation

What commenters say

  • The use of undocumented APIs is a potential red flag for Firefox's improved responsiveness on macOS.
  • App stores can be useful for distribution and security, but they can also be restrictive and take a large cut of payments.
  • Some commenters believe that app stores are not truly curated and do not provide sufficient safety for users.
  • Others argue that app stores provide a convenient distribution channel and can be useful for developers.
  • There are concerns that Apple may ban non-App Store apps in the future, which could affect technical users.
  • Firefox on iOS has experienced slowdowns and crashes, which may be related to the URL bar functionality.
  • The browser engine used by Firefox on iOS is the same as Safari, but the UI and surrounding code are different and may cause issues.
  • High-performance locking mechanisms can be complex and require careful consideration of factors like CPU architecture and contention.
  • Some locks may need to allocate memory, which can create circular dependencies and other issues.