<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/optimizing-3d-performance-with-virglrenderer-8ux9xx8tf" -->

---
title: Optimizing 3D performance with virglrenderer | daily.dev
description: Collabora engineers applied micro-optimizations to virglrenderer, the virtualized 3D GPU renderer used with CrosVM and QEMU. Using Perfetto and Linux perf for...
canonical: https://daily.dev/posts/optimizing-3d-performance-with-virglrenderer-8ux9xx8tf
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Optimizing 3D performance with virglrenderer | daily.dev
og:description: Collabora engineers applied micro-optimizations to virglrenderer, the virtualized 3D GPU renderer used with CrosVM and QEMU. Using Perfetto and Linux perf for...
og:url: https://daily.dev/posts/optimizing-3d-performance-with-virglrenderer-8ux9xx8tf
og:image: https://api.daily.dev/og/posts/8uX9Xx8Tf.png
og:image:alt: Optimizing 3D performance with virglrenderer
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Optimizing 3D performance with virglrenderer

**[Collabora Blog](https://daily.dev/sources/collabora)** · 9 min read · 0 upvotes · 0 comments

## Summary

Collabora engineers applied micro-optimizations to virglrenderer, the virtualized 3D GPU renderer used with CrosVM and QEMU. Using Perfetto and Linux perf for profiling, they identified two main hot-spots: redundant pointer dereferencing in the command stream decoding loop, and a linear shader program lookup that averaged 120 iterations per draw call. Fixes included refactoring the decode loop to reduce redundant checks, replacing a single shader program list with 64 hash-bucketed lists (reducing average lookup iterations from 120 to ~60), improving the resource hash function to reduce collisions, and dropping a legacy Intel driver workaround. Benchmarks on AMD FX-6300 + Radeon RX 580 running Mesa 21.1.0-devel showed improvements across 7 of 8 workloads, with Unigine Heaven gaining 6.2% FPS and GLmark2 gaining 3.1%.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.collabora.com/news-and-blog/blog/2021/05/17/optimizing-3d-performance-with-virglrenderer>

## Questions this post answers

### How does virglrenderer look up linked shader programs and why is it a performance bottleneck?

virglrenderer iterates a single linked list of all compiled shader programs on every draw call, checking vertex shader ID, fragment shader ID, dual-source state, and compute shader presence. With complex scenes like Unigine Heaven, this loop body executes an average of 120 times per draw call. Splitting the list into 64 hash-bucketed queues and moving recently used entries to the front reduces the average to about 60 iterations.

_Engineers tuning GPU driver hot-paths track virglrenderer and Mesa internals like this on daily.dev._

### What performance gains were measured after optimizing virglrenderer shader lookup and command decoding?

Benchmarks on AMD FX-6300 with Radeon RX 580 running Mesa 21.1.0-devel showed 7 of 8 workloads improved: Unigine Heaven gained 6.2% FPS (60.7 to 64.5), GLmark2 gained 3.1% (1273 to 1312), GPUtest/FurMark gained 3.2%, and Unigine Sanctuary, Tropics, and Valley gained 2.7%, 2.9%, and 2.1% respectively. Only Open Arena showed a regression (-0.4%), which fell within the confidence interval.

_Developers benchmarking virtualized GPU workloads find comparative results and driver optimization write-ups on daily.dev._

## Similar posts on daily.dev

- [Marek Olšák Scores Up To 100% Pixel Throughput Optimization For RADV Driver](https://daily.dev/posts/marek-ol-k-scores-up-to-100-pixel-throughput-optimization-for-radv-driver-yi3vufzy0) · Phoronix · 0 upvotes · 0 comments
- [Cracking Windows Open: Porting RADV to WIN32](https://daily.dev/posts/cracking-windows-open-porting-radv-to-win32-f2n59xdec) · Hacker News · 0 upvotes · 0 comments
- [Mesa 25.3 Unleashed: Revolutionizing Open-Source Graphics for Linux Power Users](https://daily.dev/posts/mesa-25-3-unleashed-revolutionizing-open-source-graphics-for-linux-power-users-9noeiyani) · Khronos · 0 upvotes · 0 comments
- [Optimizing CPU-side Rendering Code – Godot Engine](https://daily.dev/posts/optimizing-cpu-side-rendering-code-godot-engine-ty7sjfltq) · Godot · 15 upvotes · 0 comments

---

Tags: [#infrastructure](https://daily.dev/tags/infrastructure)

[View this post on daily.dev](https://daily.dev/posts/optimizing-3d-performance-with-virglrenderer-8ux9xx8tf)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Optimizing 3D performance with virglrenderer","url":"https://daily.dev/posts/optimizing-3d-performance-with-virglrenderer-8ux9xx8tf","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/optimizing-3d-performance-with-virglrenderer-8ux9xx8tf"},"datePublished":"2026-08-11T08:53:29.923Z","dateModified":"2026-08-11T09:12:44.906Z","description":"Collabora engineers applied micro-optimizations to virglrenderer, the virtualized 3D GPU renderer used with CrosVM and QEMU. Using Perfetto and Linux perf for...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/e21d67dcd11d7570b8d39b4ec8db41c7?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/e21d67dcd11d7570b8d39b4ec8db41c7?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Collabora Blog","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Collabora Blog","logo":"https://media.daily.dev/image/upload/s--ZGZ0FjqS--/f_auto,q_auto/v1786438306/logos/collabora?_a=BAMAMicg0","url":"https://daily.dev/sources/collabora"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/optimizing-3d-performance-with-virglrenderer-8ux9xx8tf","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"infrastructure","timeRequired":"PT9M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Collabora Blog","item":"https://daily.dev/sources/collabora"},{"@type":"ListItem","position":3,"name":"Optimizing 3D performance with virglrenderer"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/optimizing-3d-performance-with-virglrenderer-8ux9xx8tf#faq","mainEntity":[{"@type":"Question","name":"How does virglrenderer look up linked shader programs and why is it a performance bottleneck?","acceptedAnswer":{"@type":"Answer","text":"virglrenderer iterates a single linked list of all compiled shader programs on every draw call, checking vertex shader ID, fragment shader ID, dual-source state, and compute shader presence. With complex scenes like Unigine Heaven, this loop body executes an average of 120 times per draw call. Splitting the list into 64 hash-bucketed queues and moving recently used entries to the front reduces the average to about 60 iterations. Engineers tuning GPU driver hot-paths track virglrenderer and Mesa internals like this on daily.dev."}},{"@type":"Question","name":"What performance gains were measured after optimizing virglrenderer shader lookup and command decoding?","acceptedAnswer":{"@type":"Answer","text":"Benchmarks on AMD FX-6300 with Radeon RX 580 running Mesa 21.1.0-devel showed 7 of 8 workloads improved: Unigine Heaven gained 6.2% FPS (60.7 to 64.5), GLmark2 gained 3.1% (1273 to 1312), GPUtest/FurMark gained 3.2%, and Unigine Sanctuary, Tropics, and Valley gained 2.7%, 2.9%, and 2.1% respectively. Only Open Arena showed a regression (-0.4%), which fell within the confidence interval. Developers benchmarking virtualized GPU workloads find comparative results and driver optimization write-ups on daily.dev."}}]}
```

