Best of PerformanceDecember 2024

  1. 1
    Article
    Avatar of communityCommunity Picks·1y

    High Performance Images: 2024 Guide

    Learn how to optimize images for faster website performance in 2024 by choosing the right format, adjusting resolution, using lossy compression, embedding images, and implementing lazy-loading. These techniques improve Core Web Vitals, reduce load times, and enhance user experience.

  2. 2
    Video
    Avatar of joshuamoronyJoshua Morony·1y

    WEB WORKERS made my code over 100x faster (almost ZERO blocking time)

    Using web workers in Angular with Phaser can drastically improve performance by offloading computationally expensive tasks like the wave function collapse algorithm from the main thread. This allows the game to render terrain without causing freezing or requiring loading screens. Web workers handle the heavy computations and communicate results back to the main thread, ensuring smooth gameplay and responsive UI.

  3. 3
    Article
    Avatar of devtoDEV·1y

    Tracking down high memory usage in Node.js

    The post discusses a developer's approach to tracking and fixing high memory usage in Node.js applications. It covers understanding the code, replicating the issue, capturing memory profiles from staging services, and verifying the fix. The result was a significant reduction in memory usage and better service reliability.

  4. 4
    Article
    Avatar of communityCommunity Picks·1y

    Why PHP 8 Has High Performance

    PHP 8 significantly improves performance with the introduction of the JIT compiler, optimized function calls and array operations, new data structures such as the Red-Black Tree, and fixes to internal implementation details. These enhancements lead to better execution speed and memory management, making web application development more efficient.

  5. 5
    Article
    Avatar of logrocketLogRocket·1y

    Lazy loading vs. Eager loading

    Performance is a crucial aspect of software development, especially how data is accessed. Lazy loading and eager loading are two techniques that can significantly impact this. Lazy loading loads resources only when needed, improving user experience and conserving bandwidth, while eager loading fetches all data upfront, simplifying code and ensuring data consistency. The post demonstrates both techniques using React components, illustrating how they can enhance the performance and responsiveness of single-page applications.

  6. 6
    Article
    Avatar of communityCommunity Picks·1y

    How React Compiler Performs on Real Code

    React Compiler, a tool developed by the React core team, aims to improve app performance by handling memoization automatically. It can reduce the number of re-renders without the need for `useMemo` and `useCallback` hooks. This investigation measured its impact on both initial load performance and interaction performance, finding mostly positive results with minimal initial load impact and noticeable interaction improvements. It can’t catch all re-renders, but it could be 'good enough' for many apps. Advanced performance optimization may still require manual memoization.

  7. 7
    Article
    Avatar of tigerabrodiTiger's Place·1y

    Performance Principles

    The post discusses various principles and techniques for improving performance in programming. It covers reducing workload by optimizing code logic, using more efficient data structures like maps, implementing caching to avoid repeated computations, and prefetching resources to improve perceived performance. The post also provides specific examples and emphasizes considerations for mobile environments.

  8. 8
    Article
    Avatar of trendyoltechTrendyol Tech·1y

    Web Performance Optimization Techniques

    Fast-loading websites are essential for user experience, search engine ranking, and revenue. Techniques for optimizing web performance include reducing dependencies, dynamic imports, tree shaking, image optimization, async components, and server-side compression. Tools like Google Lighthouse, PageSpeed Insights, and WebPageTest can help assess performance and identify areas for improvement. Effective strategies such as using CDNs, caching, and minimizing bundle sizes contribute to faster load times and enhanced user satisfaction.

  9. 9
    Article
    Avatar of systemdesigncodexSystem Design Codex·1y

    How Netflix Uses Caching To Hold Attention?

    Netflix employs EVCache, a distributed in-memory key-value store, to enhance streaming performance. Key use cases include look-aside cache for quicker data access, transient data store for real-time updates, primary store for precomputed user homepage data, and caching high-volume UI elements for seamless global access. These strategies minimize latency, improve scalability, and ensure a superior user experience by swiftly delivering personalized content.

  10. 10
    Article
    Avatar of awegoAwesome Go·1y

    Are Pointers in Go Faster Than Values?

    New Go developers might assume that pointers are always faster than values because copying is slow. However, it's essential to focus on writing clear and maintainable code first. While local non-pointer variables on the stack are generally faster than pointers, using pointers should be reserved for cases where a shared reference is needed. Performance issues related to stack and heap allocation should be addressed through benchmarking and tangible optimization efforts.

  11. 11
    Article
    Avatar of lnLaravel News·1y

    Performance Optimization via Conditional Relationship Loading

    Laravel's API Resources feature whenLoaded() allows conditional inclusion of relationship data in API responses, optimizing performance by avoiding unnecessary database queries. Examples showcase dynamic relationship loading based on request parameters, conditional inclusion of nested resources, and optimized query loading for better efficiency.

  12. 12
    Video
    Avatar of t3dotggTheo - t3․gg·1y

    I love Tailwind, but this is scary...

    Tailwind CSS V4 introduces several changes and improvements, including moving to Lightning CSS for better performance, adding CSS-first configuration, and supporting radial and conic gradients. However, some features have raised concerns such as the impact of using CSS variables on performance, potential maintainability issues with descendant and child variants, and the use of double-star selectors. Critical feedback highlights the need for caution in adopting these new features to ensure code maintainability and performance.

  13. 13
    Article
    Avatar of communityCommunity Picks·1y

    Make 5x faster outbound requests in Laravel

    Learn how to make outbound HTTP requests up to 5x faster in Laravel using a trick with Laravel Octane. By reusing connections and keeping them as static variables, you can drastically reduce the overhead of repeatedly establishing new connections. This method can be particularly beneficial for applications making frequent external API calls and in scenarios like queues where the application stays in memory.

  14. 14
    Article
    Avatar of csswizardryCSS Wizardry·1y

    Critical CSS? Not So Fast!

    Critical CSS is a theoretically good technique to optimize initial rendering but is often fragile and costly to implement in practice. It works best when CSS is the biggest blocking resource and should be considered from the project outset rather than retrofitted. Success depends on various factors including the proper handling of other render-blocking resources. Missteps in implementation or subsequent changes can negate its benefits, making it essential to carefully assess and maintain any critical CSS strategies.

  15. 15
    Article
    Avatar of newstackThe New Stack·1y

    Mastering Progressive Hydration for Enhanced Web Performance

    Progressive hydration is a technique to enhance web application performance by gradually loading interactive components. It improves user experience, particularly in large applications, by prioritizing essential parts for immediate interaction and deferring non-critical elements. Unlike lazy loading, which delays resource loading, progressive hydration focuses on a specialized hydration process after server-side rendering. This approach optimizes key performance metrics and ensures a responsive interface. The post provides detailed steps for implementing progressive hydration in a React app and suggests using performance monitoring tools for evaluation.

  16. 16
    Video
    Avatar of codeheimcodeHeim·1y

    #69 Golang - Mastering Bloom Filters

    Bloom filters are probabilistic data structures used to check if an element is part of a set quickly and with minimal memory usage. They guarantee no false negatives but allow false positives. Ideal for caching and pre-filtering large datasets, bloom filters can reduce unnecessary database queries in web applications. The post details how to install and implement a bloom filter in a Golang-based web app for checking user access to features, along with parameter estimation for optimizing performance.

  17. 17
    Article
    Avatar of golangGo·1y

    Go Protobuf: The new Opaque API

    Go Protobuf has introduced a new Opaque API to improve performance and memory efficiency by decoupling the generated code API from the in-memory representation. This change hides struct fields and replaces direct field access with getter and setter methods. The Opaque API supports lazy decoding and reduces pointer-related bugs. Migration to the Opaque API is recommended for new development, with a hybrid option available for existing codebases.

  18. 18
    Article
    Avatar of communityCommunity Picks·1y

    Lessons learned from running Redis at scale

    Mattermost scaled to over 100K users by introducing Redis into their architecture, addressing issues related to cache invalidations and node synchronization. They opted for the rueidis library for better default functionalities and discovered the importance of batching commands to reduce overhead. Client-side caching was implemented to minimize application latency. They also highlight lessons learned with Redis commands like MGET/MDELETE and using SCAN efficiently, and provide insights on the use of Redis pub-sub mechanism.

  19. 19
    Article
    Avatar of cerbosCerbos·1y

    Why low latency is important in authorization

    Fast authorization checks are critical for ensuring smooth user experiences across applications. High latency can lead to user frustration, system performance issues, and increased costs. Solutions like Cerbos offer innovative approaches to mitigate latency, including running authorization checks close to the application, utilizing stateless systems, and optimizing policy management. These practices improve scalability and reliability, crucial for sectors like e-commerce, fintech, and streaming services.

  20. 20
    Video
    Avatar of codeheimcodeHeim·1y

    #66 Golang - Concurrency - Worker Pool Management with Tunny

    Learn how to use the Tunny library in Golang to manage worker pools for efficient resource utilization in concurrent systems. Tunny allows you to control the number of goroutines running simultaneously, helping optimize CPU usage and prevent excessive memory consumption. The post includes a step-by-step guide to installing Tunny, creating a worker pool, and simulating tasks like sending emails while maintaining an efficient concurrency model.

  21. 21
    Article
    Avatar of codeconfessionsConfessions of a Code Addict·1y

    Linux Context Switching Internals: Part 1 - Process State and Memory

    Context switching is essential for managing multiple processes efficiently in the Linux kernel. This post delves into how the Linux kernel represents process state and memory using key structures like task_struct and mm_struct. It discusses various process states, the significance of kernel and user mode stacks, memory segments, and how page tables facilitate virtual memory management. Understanding these fundamentals is crucial for performance optimization in complex systems.

  22. 22
    Article
    Avatar of communityCommunity Picks·1y

    Improving Laravel Sanctum Personal Access Token Performance

    The post discusses an issue with Laravel Sanctum personal access tokens where updating the `last_used_at` column caused a performance bottleneck due to frequent database writes. It provides a solution by creating a custom `PersonalAccessToken` model that overrides the `save()` method to prevent unnecessary writes. The implementation steps include generating the model, modifying the `save()` method, and configuring Sanctum to use the custom model, resulting in improved performance.

  23. 23
    Article
    Avatar of elmahelmah.io·1y

    How to bulk insert with EF Core

    Discover multiple methods for bulk inserting data with Entity Framework Core, including using the Add method, AddRange, EFCore.BulkExtensions, and ExecuteSqlRaw. Learn about their advantages, disadvantages, and best practices for optimizing performance and resource usage when handling large datasets or migrating data.

  24. 24
    Article
    Avatar of communityCommunity Picks·1y

    How Nginx Was Able to Support 1 Million Concurrent Connections on a Single Server ✨

    Nginx achieves high scalability by utilizing a master-worker model where workers handle client connections. Each worker is a separate process assigned to a CPU to minimize context switches and thread trashing. An event loop manages concurrent tasks asynchronously, aided by a thread pool for blocking tasks, and shared memory to efficiently manage cached data. This design enables Nginx to support up to 1 million concurrent connections efficiently.

  25. 25
    Article
    Avatar of infoworldInfoWorld·1y

    Cython tutorial: How to speed up Python

    Cython is a tool for making Python code faster by translating it into C. This tutorial explains how to convert Python code into Cython, use it in a production application, and provides a simple example. The new Cython syntax is now compatible with Python's own syntax, making code linting easier. The post also covers important aspects like compiling Cython code, using type annotations, leveraging the `cfunc` decorator, and managing the Global Interpreter Lock (GIL). Additionally, it discusses profiling Cython code to identify and optimize performance bottlenecks.