Home / Companies / Semaphore / Blog / June 2017

June 2017 Summaries

2 posts from Semaphore

Filter
Month: Year:
Post Summaries Back to Blog
As Rails projects grow in scope and size, previously fast actions can become slow due to the exponential growth of database tables, making lookups and updates sluggish. A simple solution to improve performance is adding missing indexes, but this poses risks, especially in live production databases where creating indexes synchronously can lock tables and cause downtime. PostgreSQL offers a concurrent index creation option, allowing index building without locking tables, although it increases CPU and I/O load and takes longer to complete. In Rails, the algorithm option in migrations can trigger concurrent index builds, but this requires disabling the default transaction wrapper using disable_ddl_transaction! to avoid locking. Implementing this method at Semaphore significantly improved job processing speed by 2.5 times. While premature optimization can be counterproductive, understanding system metrics and making informed tweaks can yield substantial performance gains. Semaphore is focused on enhancing continuous integration speed, recently introducing a feature that parallelizes test suites to reduce runtime.
Jun 21, 2017 659 words in the original blog post.
Rails controllers can face issues such as bloated actions and slow page loading times, especially as code and data increase. Adding new code can also result in blocking actions if external services fail, disrupting user experience. Semaphore addressed these challenges by splitting controller actions into smaller, asynchronous actions using the render_async gem. This gem loads content asynchronously via AJAX calls, preventing external service failures from breaking pages. By implementing render_async, the MoviesController show action was simplified, improving testability and load speed, while movie rating markup was separated into a partial to prevent blocking by external services. This approach maintains page usability even if external data like IMDB ratings are unavailable. Semaphore also offers a CI feature, Semaphore Boosters, to enhance continuous integration speed by parallelizing test suites, reflecting its commitment to fast and efficient development processes.
Jun 08, 2017 875 words in the original blog post.