Performance Optimization Techniques

Explore top LinkedIn content from expert professionals.

  • View profile for Sebastian Raschka, PhD
    Sebastian Raschka, PhD Sebastian Raschka, PhD is an Influencer

    ML/AI research engineer. Author of Build a Large Language Model From Scratch (amzn.to/4fqvn0D) and Ahead of AI (magazine.sebastianraschka.com), on how LLMs work and the latest developments in the field.

    272,110 followers

    Multi-Head Attention (MHA) is the engine of LLMs. But over the years, we have added several tweaks to make it more efficient for long-context settings, especially when using KV caching during inference. I implemented the most common variants from scratch: 1) Grouped-Query Attention (GQA): Instead of having a unique key and value for each query head, multiple queries share the same key and value. As long as the sharing ratio is not too extreme, this has minimal impact on model quality. It is the most widely used variant today and found in almost every modern LLM including Llama 2-4, GPT-OSS, Gemma 3, Qwen 3, GLM 4.6, and many others. 2) Multi-Head Latent Attention (MLA): This variant introduces a compressed latent representation for the keys and values that are stored in the KV cache. During inference, these latent keys and values are up-projected back to the full dimension. The extra projection adds a small computational cost, but the memory savings make it worth it. This approach is currently used by DeepSeek V3 and Kimi K2. 3) Sliding-Window Attention (SWA): SWA restricts each token’s attention span to a fixed local window, which reduces memory needs by shrinking the KV cache in long-context regimes. It is usually applied selectively, for example every other layer, or in Gemma 3's case, five SWA layers for each full-attention layer. While less common today, it remains an important optimization, notably in Gemma 3. All three variants, GQA, MLA, and SWA, can also be combined freely within the same model. Here's a link to check them out: 1️⃣ GQA: https://lnkd.in/grDPXUUi 2️⃣ MLA: https://lnkd.in/gm4FzE32 3️⃣ SWA: https://lnkd.in/g7x-fdgn

  • Introducing Insights in Chrome DevTools Performance panel! Many web developers know the power of the Chrome DevTools Performance panel, but navigating its wealth of data to pinpoint issues can be daunting. While tools like Lighthouse provide great summaries, they often lack the context of when and where issues occur within a full performance trace. On the Chrome team we're bridging this gap with the new "Insights sidebar" directly within the Performance panel. Read all about it: https://lnkd.in/gGd3bkPw This exciting feature integrates Lighthouse-style analysis right into your workflow. After recording a performance trace, the Insights sidebar appears, offering actionable recommendations. Crucially, it doesn't just list potential problems but highlights relevant events and overlays explanations directly on the performance timeline. Hover over an insight like "LCP by phase," "Render blocking requests" or "Layout shift culprits" to visually connect the suggestion to the specific moments in your trace. The sidebar covers key areas like Largest Contentful Paint (LCP) optimization (including phase breakdowns and request discovery), Interaction to Next Paint (INP) analysis (like DOM size impact and forced reflows), Cumulative Layout Shift (CLS) culprits, and general page load issues such as third-party impact and image optimization. It's designed to make performance debugging more intuitive by linking high-level insights to the granular data, helping you improve Core Web Vitals and overall user experience more effectively. Check out the Insights sidebar in the latest Chrome versions (it's been evolving since Chrome 131!). It’s a fantastic step towards making complex performance analysis more accessible. Give it a try on your next performance audit! #softwareengineering #programming #ai

  • View profile for Zach Wilson
    Zach Wilson Zach Wilson is an Influencer

    Founder @ DataExpert.io | 1.3m+ followers across platforms | Send me DM if you’re interested in AI/DE upskilling!

    534,022 followers

    Apache Spark has levels to it: - Level 0 You can run spark-shell or pyspark, it means you can start - Level 1 You understand the Spark execution model: • RDDs vs DataFrames vs Datasets • Transformations (map, filter, groupBy, join) vs Actions (collect, count, show) • Lazy execution & DAG (Directed Acyclic Graph) Master these concepts, and you’ll have a solid foundation - Level 2 Optimizing Spark Queries • Understand Catalyst Optimizer and how it rewrites queries for efficiency. • Master columnar storage and Parquet vs JSON vs CSV. • Use broadcast joins to avoid shuffle nightmares • Shuffle operations are expensive. Reduce them with partitioning and good data modeling • Coalesce vs Repartition—know when to use them. • Avoid UDFs unless absolutely necessary (they bypass Catalyst optimization). Level 3 Tuning for Performance at Scale • Master spark.sql.autoBroadcastJoinThreshold. • Understand how Task Parallelism works and set spark.sql.shuffle.partitions properly. • Skewed Data? Use adaptive execution! • Use EXPLAIN and queryExecution.debug to analyze execution plans. - Level 4 Deep Dive into Cluster Resource Management • Spark on YARN vs Kubernetes vs Standalone—know the tradeoffs. • Understand Executor vs Driver Memory—tune spark.executor.memory and spark.driver.memory. • Dynamic allocation (spark.dynamicAllocation.enabled=true) can save costs. • When to use RDDs over DataFrames (spoiler: almost never). What else did I miss for mastering Spark and distributed compute?

  • View profile for Brij Kishore Pandey

    AI Architect & Engineer | Agentic systems, RAG, AI infrastructure, Data Engineering | 738K+ LinkedIn, 294K+ Instagram | Newsletter for 250K AI builders

    740,466 followers

    𝗡𝗮𝗶𝘃𝗲 𝗥𝗔𝗚 𝘄𝗼𝗿𝗸𝘀 𝗶𝗻 𝗮 𝗱𝗲𝗺𝗼. 𝗜𝘁 𝗳𝗮𝗶𝗹𝘀 𝘁𝗵𝗲 𝗺𝗼𝗺𝗲𝗻𝘁 𝗿𝗲𝗮𝗹 𝘂𝘀𝗲𝗿𝘀 𝘀𝗵𝗼𝘄 𝘂𝗽. Embed → retrieve → generate looks clean in a notebook. Real requirements break it: → Questions whose answer is spread across many documents → Industry terms that embeddings get wrong → Bad chunks the pipeline never catches → Answers that live in how things connect, not in any single chunk → PDFs full of tables and images a text-only index cannot read These 5 architectures are how serious teams stay ahead in the agentic AI era: 𝟬𝟭 𝗛𝘆𝗯𝗿𝗶𝗱 𝗥𝗔𝗚 → Dense vectors find meaning. BM25 finds exact words. → Reciprocal Rank Fusion combines both ranked lists. → A safe baseline for almost every team. 𝟬𝟮 𝗚𝗿𝗮𝗽𝗵𝗥𝗔𝗚 → Pull entities and their relationships into a knowledge graph. → Retrieve subgraphs and community summaries, not chunks. → Best when the answer lives in how things connect. 𝟬𝟯 𝗔𝗴𝗲𝗻𝘁𝗶𝗰 𝗥𝗔𝗚 → A planner agent picks the right tool: vector, web, or SQL. → A reasoner agent keeps trying until the answer is solid. → Retrieval becomes a plan, not a single step. 𝟬𝟰 𝗖𝗼𝗿𝗿𝗲𝗰𝘁𝗶𝘃𝗲 𝗥𝗔𝗚 (𝗖𝗥𝗔𝗚) → Grade every retrieval before you trust it. → Correct → answer. Unclear → rewrite the query. Wrong → search the web. → This is what production RAG actually looks like. 𝟬𝟱 𝗠𝘂𝗹𝘁𝗶𝗺𝗼𝗱𝗮𝗹 𝗥𝗔𝗚 → One embedding model (CLIP, ColPali) for text, images, and tables. → One vector index. One multimodal LLM. → No more separate pipelines for PDFs with charts. I built a runnable example for each of the five patterns. GitHub link in the first comment. The best teams in 2026 do not pick one. They combine them — hybrid retrieval inside an agentic loop, with a corrective grader, over a multimodal index. Naive RAG is a starting point, not a finish line. That is why most enterprise GenAI projects stall at the demo. Which of these five becomes the default RAG stack in the next 18 months — and which stays a specialized tool?

  • View profile for Milan Jovanović
    Milan Jovanović Milan Jovanović is an Influencer

    Practical .NET and Software Architecture Tips | Microsoft MVP

    295,463 followers

    𝗦𝗰𝗮𝗹𝗶𝗻𝗴 𝘁𝗼 𝟭,𝟬𝟬𝟬,𝟬𝟬𝟬 𝗨𝘀𝗲𝗿𝘀: 𝗔 𝗣𝗿𝗮𝗰𝘁𝗶𝗰𝗮𝗹 𝗣𝗼𝘀𝘁𝗴𝗿𝗲𝗦𝗤𝗟 𝗔𝗽𝗽𝗿𝗼𝗮𝗰𝗵 I once worked on a system that grew from zero to over a million users. It started as a monolith: one app server, one database. That was fine for a while. But as traffic grew, performance dropped. The database became the bottleneck. We didn't jump straight to microservices or complex orchestration. We took a practical, step-by-step approach to evolve our database architecture. Here is the journey depicted in the graphic below: 1️⃣ Initial Launch: Started with a single, robust PostgreSQL primary instance. Simple and cost-effective. 2️⃣ Distribute Reads: When read traffic increased, we added Read Replicas behind a load balancer. The primary handled writes; replicas handled reads. 3️⃣ Optimize Connections: As concurrency spiked, we were exhausting database connections. We introduced pgBouncer for efficient connection pooling. 4️⃣ Caching at Scale: To hit 1M+ users, we needed to stop hitting the DB for everything. We added Redis to cache frequently accessed data. The main lesson: Solve the problem you have right now. Don't build architecture for 5 years from now if you don't have customers today. Overengineering before there is real demand is a trap. Your application supports a business. If the business isn’t working, scaling won’t fix it. 👉 Learn more about scaling applications here: https://lnkd.in/dyP-rghS What’s the biggest bottleneck you’ve faced when scaling an app? --- Do you want to simplify your development process? Grab my Clean Architecture template here and save 7 days of development time: https://lnkd.in/dYNsNb52

  • The future belongs to companies that master AI agent orchestration. Here's why 99% of companies get it wrong: Most companies try to build AI with random LLMs chained together. This is amateur hour. Professional AI requires an understanding of when to use: • Crews: For collaborative, multi-step tasks that need multiple perspectives • Flows: For precise, structured processes that can't fail • Hybrid: For complex enterprise solutions needing both After analyzing thousands of implementations, here's what separates the winners: The Complexity-Precision Matrix: • Low Complexity, Low Precision → Simple Crews Perfect for research and creative tasks where flexibility matters • Low Complexity, High Precision → Flows When you need exact, repeatable outputs every time • High Complexity, Low Precision → Complex Crews For tasks requiring deep analysis and multiple expert perspectives • High Complexity, High Precision → Flows with Crews Enterprise solutions that can't compromise on accuracy or depth We've just released 5 comprehensive guides to master this: 1. Crafting Effective Agents The 80/20 principle: 80% task design, 20% agent configuration Most teams get this backwards 2. Building Your First Crew How to create AI teams that truly collaborate Not just chain responses like everyone else 3. Implementing Flows Transform basic automations into enterprise-grade systems Build for scale from day one 4. Mastering Flow State The hidden element that 90% of developers miss Critical for enterprise implementations 5. Evaluating Use Cases A framework to choose the right approach Avoid costly mistakes before they happen Here's what nobody's talking about: In 3-5 years, enterprises will run thousands of AI agents. You'll need: • A control plane for organization • Enterprise-grade governance • Compliance frameworks • Agent lifecycle management While others focus on basic features, we're building the infrastructure for AI-native enterprises. Want to build professional AI that actually works? Start here: https://docs.crewai.com Follow me for insights on building enterprise AI that delivers real ROI. #CrewAI #EnterpriseAI #AIOrchestration

  • Our frontend builds crossed 20 minutes. The obvious move was to rip out Webpack for something faster. We didn't. Before touching a single line of config, we profiled the entire pipeline. Webpack's ProgressPlugin turned up something we didn't expect — one plugin, Terser, was eating 13+ minutes of every build. Webpack wasn't the bottleneck. JavaScript minification was. 🔍 That one number changed the whole plan. We kept Webpack. Replaced Babel with SWC. Swapped Terser for esbuild. Moved CSS optimisation to LightningCSS. Parallelised compilation across cores with thread-loader. ⚙️ Fixed a hidden bottleneck too — AWS CodeArtifact tokens were re-authenticating every 12 hours and quietly busting our Docker cache. Restructured the Dockerfile into layers that actually cache. 🐳 20 minutes to 2 minutes. Cold build ~90% faster. Incremental ~95% faster. Across 20 production apps, 600+ PRs a month, 5,000+ CI runs. ⚡ No migration. No four-week rewrite. No new bundler to debug for the next year. The real lesson wasn't about tooling. It was that we almost skipped measurement and went straight to migration — the industry default. Glad we didn't. 💡 Full breakdown — the Speed Measure Plugin data, the pnpm switch, the exact Dockerfile changes — link in the first comment. 👇 Really proud of what our engineering team pulled off here. Worth the read. 🫡 Zepto Zepto Tech #ZeptoTechXPress #ZeptoEngineering

  • View profile for Mark Butcher
    Mark Butcher Mark Butcher is an Influencer
    12,847 followers

    Wow, the energy impact of using Microsoft collaboration tools is surprisingly large! We've just completed some fascinating actual energy usage testing that showed how user behaviour massively impacts the power consumption of #Copilot, #Teams & #Outlook. The results make for uncomfortable reading: 1) Having cameras on in Teams meetings more than doubled power use. Turning them off by default instantly halved energy related emissions. 2) Screen sharing in Teams increased energy consumption by nearly 40%. 3) Using Copilot added between 45% to 80% more energy use, with limited accuracy or real value being reported. 4) Background apps were a hidden drain. Leaving Outlook open all day across a large workforce can easily waste close to 100-200 MWh of energy each year. 5) Outlook consumed 85% less power when minimised. And when you multiply small inefficiencies by the roughly 320 million global users of Teams alone, the system-level impact is huge. Also, for home workers, don't forget the impact on your home power bill! This is just the start of our testing as we're looking at testing on many different device types, are adding in new scenarios, like Copilot in other Office apps and more. But... it goes to show that our obsession with online meetings and shoehorning #AI into every conversation has a massive impact on the planet. Don't be an accidental energy vampire!

  • View profile for Armand Ruiz
    Armand Ruiz Armand Ruiz is an Influencer

    ai @meta - the upside is infinite

    207,770 followers

    A customer asked me WHY fine-tuning at all when they can get all they want with RAG. Both methods require additional data to improve model performance, but they differ in how they use that data. Let's understand the basics: - Fine-tuning tailors the LLM's weights to specific domains and tasks, improving performance on long-term challenges. - RAG, on the other hand, injects up-to-date, relevant information at inference time, addressing quick-to-change needs. You will want to fine-tune to move out of very large LLMs that are not cost-effective. A Small Language Model (SLM) tuned for your use case can yield 10-50x savings in production. My recommendation for companies implementing GenAI is to follow this sequence: 1. Start with a very large LLM and great prompting - this will help you test your use case quickly 2. Move to a RAG implementation - start grounding your model with your data to improve accuracy 3. Then, we move to fine-tuning and combine techniques to take AI performance and optimize it for cost. The answer to RAG vs. fine-tuning is not an either/or choice. The two techniques complement each other brilliantly. For example, a fine-tuned customer support chatbot could leverage RAG to incorporate the latest customer data, providing contextual and personalized responses. We don't have to pick sides. Embracing the synergy between RAG and fine-tuning can unlock their true potential in real-world applications.

  • View profile for Vitaly Friedman
    Vitaly Friedman Vitaly Friedman is an Influencer

    Practical insights for better UX • Running “Measure UX” and “Design Patterns For AI” • Founder of SmashingMag • Speaker • Loves writing, checklists and running workshops on UX. 🍣

    234,683 followers

    🏎️💨 How To Design For Aging Population. One billion people aged 60+ live today, and it’s growing faster than any other age group. Key points to consider for more age-inclusive UX ↓ 🚫 Don’t assume that older adults struggle to use digital. ✅ Most users are healthy, active and have a solid income. 🤔 With age, it’s more difficult to focus on close objects. 🤔 Visuals with a similar contrast are harder to tell apart. 🤔 60 years → need 3× more light to perceive same brightness. 🤔 With age, shades of blue/purple, yellow/green look similar. 🤔 Reduced dexterity causes errors with precise movements. ✅ Add UI controls to resize columns, move cards, drag-n-drop. ✅ Always confirm destructive actions, allow to Undo/restore. 🚫 Avoid disappearing messages as toasts: let people close them. ✅ Baseline: large body copy (16px+), color contrast (WCAG AA). ✅ Prefer plain language, large checkboxes, radios (36px+). ✅ Avoid small floating labels and use static field labels. ✅ Show error messages above the text input, not below. 🚫 Don’t rely on accessibility overlays; they are trouble. Accessibility doesn’t have to be dull or boring. It doesn’t come at the cost of oversimplification — it can be bold and passionate, while understanding and respecting the needs of the different audiences it caters to. If anything, it makes boldness more accessible to more people. Conversations about older audiences tend to come with plenty of assumptions and stereotypes — and very often they are simply inaccurate. We overgeneralize and simplify. For example, just like when designing for children, we need to study vast differences in the age groups of 60–65, 65–70 etc. Just like any other group, older users need a reliable, clear product that helps them feel independent and competent. Bring older adults in your design process to find out what their specific needs are. It’s not just better for that specific target audience — good accessibility is better for everyone. And huge kudos to wonderful people contributing to a topic that is often forgotten and overlooked. 👏🏼👏🏽👏🏾 Useful resources: Wise Case Study: Accessible But Never Boring, by Stephanie S. https://lnkd.in/d-hjj_BF Designing For Older Audiences, by Matthew Stephens https://lnkd.in/dAXZ9mp3 Better Microcopy For Older Adults, by Michal Halperin Ben Zvi (PhD.), Kinneret Yifrah https://lnkd.in/evWGFB6u What You Can Learn From Older Adults, by Becca Selah https://lnkd.in/eZdbgRyA Designing Age-Inclusive Products, by Michal Halperin Ben Zvi (PhD.) https://lnkd.in/eQZJwEgS [continues in the comments below ↓] #ux #accessibility

Explore categories