Best of PerformanceAugust 2024

  1. 1
    Article
    Avatar of itnextITNEXT·2y

    Frontend Performance Love Story

    Discover innovative methods to enhance frontend performance, focusing on optimizing the initial load and fast page navigation. Learn about the Neo client approach using small JavaScript HTML-generators, avoiding server-side rendering (SSR) and hydration complexities. Explore the challenges of bundling tools with apps that allow user-generated code at runtime, and how to run development and production versions concurrently. Interactive multi-window views and upcoming performance boosts are also discussed.

  2. 2
    Article
    Avatar of medium_jsMedium·2y

    Flutter Vs React Native : Performance Benchmarks you can’t miss ! 🔥⚡️

    When choosing between Flutter and React Native for mobile app development, performance is a crucial factor. A recent benchmarking study compared app size, memory, and CPU usage for three app types on both frameworks using current versions. Flutter generally showed smaller APK sizes and better CPU & memory usage, with smoother scrolling and fewer framedrops compared to React Native. However, React Native had a higher FPS in bulk Lottie animations but at the cost of increased CPU and memory usage. The findings suggest that while both have their strengths, Flutter slightly edges out in overall performance efficiency.

  3. 3
    Article
    Avatar of systemdesigncodexSystem Design Codex·2y

    Database Sharding

    Sharding is a method for horizontally scaling databases by partitioning data into smaller, manageable pieces, known as shards. It can be implemented logically within the same server or physically across different servers. Key-based, range-based, and directory-based sharding are some strategies used depending on the needs. Each has its benefits and drawbacks, and the choice depends on whether read or write optimization is prioritized. Sharding can help improve performance by reducing the quantity of data each query needs to handle but also introduces complexity and potential hotspots.

  4. 4
    Article
    Avatar of communityCommunity Picks·2y

    Why Is Next.Js 15 Revolutionizing Web App Development?

    Next.js 15 Release Candidate introduces major updates aimed at enhancing web application development. Key features include full support for React 19 RC, revamped caching strategies with configurable invalidation periods, and experimental Partial Prerendering for hybrid rendering approaches. Additionally, the release introduces a new next/after API for handling secondary tasks post-response and updates to the create-next-app tool, including support for Turbopack. Improvements in bundling external packages and hydration error handling further optimize performance and simplify debugging. Developers are encouraged to explore these features to prepare for the official release.

  5. 5
    Article
    Avatar of neontechNeon·2y

    Top 3 features in Postgres 17

    Postgres 17 introduces significant improvements aimed at enhancing developer experience and performance. Key features include MERGE command with RETURNING support for more efficient queries, enhanced JSON functions for better handling of semi-structured data, and several performance optimizations like improved parallel query processing and faster vacuum operations. Contributions from Neon engineers include detailed query analysis with EXPLAIN (SERIALIZE), parallel builds for BRIN indexes, and enhancements to B-tree index performance.

  6. 6
    Article
    Avatar of awegoAwesome Go·2y

    Golang Defer: From Basic To Traps

    The defer statement in Go delays the execution of a function until the surrounding function finishes, useful for cleanup actions like closing resources. There are three types of defer in Go: heap-allocated, stack-allocated, and open-coded, each with different performance characteristics. Multiple defers are executed in a last-in-first-out order, and recover can regain control after a panic within a deferred function. Deferred function arguments are evaluated immediately, which can lead to complexities if not handled properly. Proper error handling with defer includes capturing defer return values.

  7. 7
    Article
    Avatar of webdevbeehiivWeb Developer·2y

    Modern CSS 🎨, Code Refactoring 🔄, React Tips 💡

    The post covers topics including effective code refactoring practices, an introduction to the Vitest testing library, using Makefiles for development task automation, tips for using Tailwind CSS, and modern web performance features in Chrome DevTools. It also features tools for image comparison, tunneling, media playback, and Vim-style shortcuts for Windows.

  8. 8
    Article
    Avatar of quastorQuastor Daily·2y

    How Notion Decreased Latency by 20% with Caching

    Notion achieved a 20% improvement in page navigation speeds by implementing SQLite for client-side caching in their browser application. They used a 'SharedWorker' architecture with WebAssembly to overcome issues like SQLite corruption and slow disk reads/writes. The solution included utilizing web locks to prevent multiple writers and a SharedWorker to manage active tab writes, resulting in optimized caching performance.

  9. 9
    Article
    Avatar of communityCommunity Picks·2y

    6 Effective Ways to Load Content in Modern Static Sites with Next.js v14 page router

    Arthur Nikitsin from FocusReactive outlines six effective methods to load content in modern static sites using Next.js v14's pages router. The methods include Static Site Generation (SSG), Server-Side Rendering (SSR), Client-Side Rendering (CSR), Code Splitting, Lazy Loading Components, and Lazy Loading Images. Each method optimizes performance and user experience, even for static sites. While the app router offers more flexibility, it's recommended to wait for its stable release in Next.js v15.

  10. 10
    Video
    Avatar of youtubeYouTube·2y

    C# (.NET) vs. Go (Golang): Performance Benchmark in Kubernetes

    A performance benchmark comparison between C# (.NET 8) and Golang in a Kubernetes environment, testing CPU usage, memory usage, request handling, and end-user latency. The tests include a minimal API test and a typical use case with file upload to S3 and metadata storage in a Postgres database. Golang generally performs better, with lower CPU and memory usage, while C# shows higher latency. The post includes detailed metrics and setups for monitoring using Prometheus, Grafana, and cAdvisor.

  11. 11
    Article
    Avatar of devgeniusDev Genius·2y

    Why I Always Use PostgreSQL Functions For Everything

    The author advocates for using PostgreSQL functions for all database interactions to improve maintainability, readability, security, and availability. They provide a detailed analysis of encapsulating SQL queries within functions to define clear data contracts. The article also discusses handling legacy systems, managing the N+1 query antipattern, migrating to Timescale DB, and optimizing query performance. Additionally, the approach allows easy implementation of least privilege security by limiting database access to executing specific functions only.

  12. 12
    Article
    Avatar of astro_sourceAstro·2y

    Astro 4.14

    Astro 4.14 introduces new features like the experimental Content Layer API and Intellisense support inside content files. The Content Layer API allows fetching content from various sources and aims to improve performance, while Intellisense enhances frontmatter editing in content files. Other updates include deprecating dynamic `prerender` values, a new `injectTypes` integration API, and support for metastrings in code components. Upgrade using `@astrojs/upgrade` or manually through your package manager.

  13. 13
    Article
    Avatar of communityCommunity Picks·2y

    How to Search in a PHP Associative Array – Fast tips

    Associative arrays in PHP store key-value pairs and are commonly used to represent structured data. This guide explores various methods for searching values within these arrays, including using `array_key_exists`, `array_search`, `in_array`, `foreach` loops, and `array_filter`. Additionally, performance benchmarks between `array_map` and `foreach` reveal that the latter is more efficient for larger datasets due to the overhead of callback functions in `array_map`.

  14. 14
    Article
    Avatar of medium_jsMedium·2y

    High-Performance Python Data Processing: pandas 2 vs. Polars, a vCPU Perspective

    Polars is emerging as a strong competitor to pandas for Python data analysis, boasting significant performance improvements due to its Rust backend optimized for parallel processing and vectorized operations. This post tests Polars against pandas with varying vCores, finding Polars generally faster, though it encounters some challenges with single vCore setups. While Polars shows great promise, considerations like cost, compatibility, and maturity remain important when evaluating a switch from pandas.

  15. 15
    Article
    Avatar of baeldungBaeldung·2y

    Java Virtual Machine Tutorials

    Java applications often face slow startup and warmup times. The CRaC project from OpenJDK addresses this by creating a performance checkpoint and restoring the JVM at that point. BellSoft offers optimized containers for Java applications, packaging Alpaquita Linux and Liberica JDK, enabling easy integration of CRaC in Spring Boot applications.

  16. 16
    Article
    Avatar of quastorQuastor Daily·2y

    How Notion Decreased Latency by 20% with Caching

    Notion boosted page navigation speed by 20% on its website by implementing client-side caching using SQLite and WebAssembly. They utilized a 'SharedWorker' architecture to handle data writing, resolving issues related to database corruption and slow disk reads. This approach significantly improved user experience without regressing other performance metrics.

  17. 17
    Article
    Avatar of pandProAndroidDev·2y

    Flutter clean code and best practices

    The document provides an overview of clean code principles and best practices in Flutter development. Key highlights include the importance of maintainability, readability, and scalability in coding. It covers naming conventions, consistent formatting, code reviews, and project organization. Best practices mentioned include leveraging Dart’s strong typing, using built-in widgets, optimizing performance, and writing unit and integration tests. Performance optimization tips include avoiding unnecessary widget builds, caching images, and efficient state management. The document also stresses the importance of error handling, dependency injection, and memory management.

  18. 18
    Article
    Avatar of nuxt_sourceNuxt·2y

    Introducing Nuxt Scripts · Nuxt Blog

    Nuxt Scripts, a collaboration between the Nuxt team and Google's Chrome Aurora team, aims to improve the handling of third-party scripts in web applications. The new module enhances performance, privacy, security, and developer experience by providing features like script loading management, full type-safety, script registry for common third-party scripts, and advanced triggers for consent management and user interactions. Nuxt Scripts also mitigates security risks by allowing scripts to be bundled and loaded from your own domain.

  19. 19
    Article
    Avatar of infoqInfoQ·2y

    What Can You Learn From the Fastest Code in the World?

    Explore various optimization techniques to enhance code speed, especially in networking scenarios where processing packets efficiently is critical. Techniques covered include inline functions, compiler optimizations, advanced data structures like Swiss Tables, interleaved processing to reduce cache misses, and loop unrolling. Practical examples are used to demonstrate how these methods can reduce processing time from 1000 clocks per packet to just 65 clocks. The importance of benchmarking and understanding trade-offs in optimizations is also highlighted.

  20. 20
    Article
    Avatar of asayerasayer·2y

    Introducing the Compiler in React 19

    React 19 introduces a compiler that automatically handles memoization, reducing unnecessary re-renders and boosting performance. Unlike previous manual techniques like React.memo, useMemo, and useCallback, the compiler automatically caches components, making code simpler and more efficient. By comparing outputs with and without the compiler, the post demonstrates the performance improvements achieved. Setup instructions and potential error handling are also covered.

  21. 21
    Article
    Avatar of communityCommunity Picks·2y

    Password Complexity, Hash Iterations and Entropy

    Neon is exploring whether it's feasible to reduce SCRAM password hashing iterations from 4096 to one, aiming to enhance CPU efficiency without compromising security. By increasing password length, they can maintain security levels despite fewer iterations, due to random password generation mitigating dictionary attacks. Their approach balances security with performance, asserting that longer passwords can effectively replace higher iteration counts.

  22. 22
    Article
    Avatar of communityCommunity Picks·2y

    DOM Performance (Reflow & Repaint) (Summary)

    Understanding how the browser renders documents can help optimize performance. The rendering process involves building the DOM, CSSOM, and RenderTree, computing the layout (reflow), and rendering pixels (repaint). Changes to visibility trigger repaints, while layout changes trigger reflows. Minimizing reflows and repaints can be achieved through techniques like batching DOM changes, caching computed styles, and optimizing selectors.

  23. 23
    Article
    Avatar of syncfusionSyncfusion·2y

    Optimize Memory Management in JavaScript Pivot Table: Best Practices and Tips

    Learn best practices for optimizing memory management in Syncfusion JavaScript Pivot Table, covering techniques like virtual scrolling, data preprocessing, and regular memory profiling. These strategies ensure smooth performance with large datasets and enhance user experience by reducing memory consumption and improving responsiveness.

  24. 24
    Article
    Avatar of communityCommunity Picks·2y

    Laravel Config Problem: Is It Time for a Revolution?

    Laravel's configuration caching system boosts performance by merging all config files into a single array saved as a PHP file, reducing I/O operations and load times. However, using objects in configurations poses challenges due to serialization issues with the `php artisan config:cache` command. The post explores workarounds and the potential to implement a strategy pattern or adopt approaches from other frameworks, such as Spiral, to enable objects in Laravel configurations without compromising performance.

  25. 25
    Article
    Avatar of hnHacker News·2y

    nicbarker/clay: High performance UI layout library in C.

    Clay, a high performance 2D UI layout library in C, offers microsecond layout performance and a flex-box like model. It features zero dependencies, Wasm support, static arena-based memory usage, and a renderer-agnostic output. The library can compile to a 15kb uncompressed .wasm file for browser use, and it supports nested declarative syntax and various UI element macros like containers, text, images, and more. Additionally, it provides simple APIs for pointer interactions and scroll container handling. Clay was designed for immediate mode rendering but can also be integrated into retained mode systems using its API for visibility culling and custom elements.