Ruby on Rails 7.2預設啟用YJIT,最多可降低25%延遲
支付動態 · 2024-08-14

Rails 7.2提升性能最佳化生產環境預設,新增開發容器支援,並重新設計官方指南,改善開發者瀏覽的整體體驗

Ruby on Rails最新7.2版本帶來許多重要更新,包括調整了生產環境的預設值,使開發者得以建立更高效的應用程式,並且加入開發環境容器的支援,另外,開發團隊還重新設計了Rails指南(Rails Guides),改進使用者查閱指南的體驗。

Ruby on Rails藉由最佳化效能和改進開發體驗,使得該框架在生產環境表現更高效,也讓開發日常工作更順暢。效能最佳化是Ruby on Rails 7.2的重點之一,Ruby即時編譯器YJIT現在成為預設啟用的功能。YJIT是Ruby 3.1加入的新編譯器,能替Rails應用程式帶來約15%到25%的延遲改善,極大程度提升應用的反應速度,這對於需要處理大量並行請求的應用特別重要。

Rails 7.2也在生產環境的設定上進行調整,將Puma網頁伺服器在處理請求使用的執行緒數,從原本預設的5降低至3,開發團隊指出,這個變動是參考長期應用程式實際運作經驗的結果,目的是要減少Ruby等待全域VM鎖(Global VM Lock,GVL)釋放的時間,進而提升應用程式在高負載情況下的效能表現。

另外,Rails 7.2生成的Dockerfile現在會包含jemalloc。jemalloc是一個最佳化的記憶體分配器,能夠有效管理應用程式的記憶體使用,這個更新可以協助開發者在部署高負荷應用程式時,獲得更穩定的效能表現。

而Rails 7.2也進一步簡化開發者本地開發環境配置,使團隊更容易保持一致的開發環境,加速開發過程。預設開發容器配置將包含Redis容器、資料庫容器、無頭Chrome容器,以及預設使用本地端磁碟儲存的Active Storage配置。開發者也可以在現有應用中添加開發容器配置,使得舊有專案也能獲得開發容器的便利。

官方藉著Rails新版本推出,發布了全新設計的官方指南,具有現代化的外觀和簡單易用的介面。新的設計風格包括更一致的字體和色彩搭配,並使用新圖標和簡化的導覽結構,提升使用者在瀏覽指南時的整體體驗。

熱門文章
GAT CDMX 2025 Institutional Academy: Leaders and Experts Analyze the Present and Future of the Gaming Industry in Mexico and Lat
Sports Game
PropellerAds Positions Itself as a Go-To Traffic Source for iGaming Advertisers Ahead of a High-Demand Season
Marketing
Indiana online casino bill stalls in House committee
Regulation
SBC Summit Canada to Make Player Safety a Key Pillar of 2026 Agenda
Marketing
Manila delivers: Highlights from SiGMA Asia 2026 
Southeast Asia
DB Gaming Is One of Asia’s Top-Tier Game Solution Providers, Recognized as a Pioneer in the Asian Gaming Industry.
Marketing
1spin4win releases unique slot Don Catleone Hold and Win featuring gangster cats
Online Game
That’s a Wrap: AffPapa Conference Madrid 2026 Highlights
Online Game
Are you ready to maximize your earnings? Try ProPush.me Constructor!
Marketing
Full House at GAT Expo Cartagena 2026 Academic Agenda
Online Game
GAT Expo CDMX 2026 Kicks Off Today in Mexico with a Sold-Out Opening Reception at Big Bola Casino Santa Fe
Marketing
Kazakhstan plans to penalise online casino promotions
Regulation
Gaming & Technology Expo Makes a Powerful Entrance in CDMX
Marketing
Vietnam’s Controlled Gaming Shift Gains Ground, But Domestic Demand Still Lags
Southeast Asia
GAT Expo Puerto Rico Will Pulse with the New Era of Gaming in the Caribbean
Marketing
首頁
遊戲
合作
發現
我的