<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Benchmarking on Ou David | Systems Engineer</title><link>https://vvivid.dev/tags/benchmarking/</link><description>Recent content in Benchmarking on Ou David | Systems Engineer</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Sat, 13 Jun 2026 10:34:19 +0700</lastBuildDate><atom:link href="https://vvivid.dev/tags/benchmarking/index.xml" rel="self" type="application/rss+xml"/><item><title>String Concatenation vs strings.Builder in Go</title><link>https://vvivid.dev/posts/go_string_concat_vs_string_builder/</link><pubDate>Sat, 13 Jun 2026 10:34:19 +0700</pubDate><guid>https://vvivid.dev/posts/go_string_concat_vs_string_builder/</guid><description>&lt;p&gt;I often leave the same comment when I see string concatenation inside a loop:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If you build a string in a loop, use &lt;code&gt;strings.Builder&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That comment sometimes gets pushback from the team: the two operations probably will not matter much. Today, I want to show a simple benchmark to demonstrate why &lt;code&gt;strings.Builder&lt;/code&gt; is superior to doing &lt;code&gt;+=&lt;/code&gt; inside a loop.&lt;/p&gt;
&lt;p&gt;The runnable code and raw benchmark output are available in the public repo: &lt;a href="https://gitlab.vvivid.dev/showcase/go-lang-case-study"&gt;gitlab.vvivid.dev/showcase/go-lang-case-study&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Go Language Case Studies</title><link>https://vvivid.dev/projects/go-lang-case-study/</link><pubDate>Sat, 13 Jun 2026 00:00:00 +0000</pubDate><guid>https://vvivid.dev/projects/go-lang-case-study/</guid><description>&lt;p&gt;This is where I keep small Go case studies that support the technical writing on this site. Each topic is built as a runnable example with tests or benchmarks, so the discussion can point to code instead of relying only on explanation.&lt;/p&gt;
&lt;p&gt;Public repo: &lt;a href="https://gitlab.vvivid.dev/showcase/go-lang-case-study"&gt;gitlab.vvivid.dev/showcase/go-lang-case-study&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The first case study compares normal string concatenation with &lt;code&gt;strings.Builder&lt;/code&gt;, including benchmark output and allocation counts.&lt;/p&gt;</description></item></channel></rss>