"How I Cut My Go Markdown Linter's Benchmark by 81%"
The article discusses the optimization of gomarklint, a Go-based Markdown linter. The author shares insights on the benchmarking process and the architectural changes that led to an 81% reduction in performance costs. Key improvements included the introduction of a shared utility for code block detection and a reliable benchmarking method.
- ▪Gomarklint is an open-source CLI Markdown linter built in Go, designed to avoid the need for Node.js.
- ▪The linter processes over 100,000 lines in under 170ms, with a typical 200-line README linting in under 0.2ms.
- ▪The optimization process involved 20 pull requests over three weeks, focusing on improving the efficiency of rule execution.
Opening excerpt (first ~120 words) tap to expand
try { if(localStorage) { let currentUser = localStorage.getItem('current_user'); if (currentUser) { currentUser = JSON.parse(currentUser); if (currentUser.id === 3422958) { document.getElementById('article-show-container').classList.add('current-user-is-article-author'); } } } } catch (e) { console.error(e); } Kazu Posted on May 26 "How I Cut My Go Markdown Linter's Benchmark by 81%" #go #performance #opensource #programming When I started optimizing gomarklint, I had no benchmarks. I had unit tests. I had coverage. But I had no idea what the linter actually cost to run on a real document. Here's what I found, what I changed, and what I'd do differently next time. What is gomarklint? gomarklint is a Go-based CLI Markdown linter I've been building as an open-source project.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at DEV.to (Top).