Full Width [alt+shift+f] Shortcuts [alt+shift+k]
Sign Up [alt+shift+s] Log In [alt+shift+l]
2

Optimizing memory use in markdown parser

from Krzysztof Kowalczyk blog [alt+shift+b] in programming

I’m porting gpui-component (a Rust UI component library built on GPUI) to C++ as gpui-cpp. By which I mean: my friend Claude does the porting, I’m just directing. It uses markdown-rs (a CommonMark + GFM parser) markdown parser so I ported it too. Then I optimized it. This post describes what I did with the intention of teaching other how to optimize C++ code. The starting point There are 2 kinds of markdown parser: those that stream nodes as they parse those that build an AST in memory markdown-rs builds an AST. The game is about minimizing the size of AST node. In Rust there are various kinds of nodes, the largest being 152 bytes. Claude generated a single Node struct of 232 bytes. I got it down to 16 bytes. Here’s the initial Node struct, before optimizations: Node, 232 bytes k children 24 position 24 8 string fields — 128 bytes align 24 nums 16 grey = padding and small fields · blue = growable vector · yellow = pointer+length strings Node, 16 bytes (same scale) lastKid · sibling · firstStr · kind+flags Where the 232 went: 8 string fields at 16 bytes each (a char* plus a length), two growable vectors at 24 bytes each (children and table alignments), a 24-byte unist Position (line, column and offset at each end), six bools one to a byte, and the padding all of that dragged in. Every node in the tree pays for every field, whichever kind it is. A Text node uses one string field and nothing else. Arena allocator It’s important that all allocations are done in an arena. Nodes in a parse tree all have the same lifetime which makes it a perfect use for an arena: a bump allocator that can only grow. The only way to free memory is to reset the arena. This is different than calling malloc() to allocate each node individually and then having to call free(). It makes it easy to measure memory usage: check the arena size after parsing. It also allows optimization...
22nd Aug 2026

Stay updated

Get a weekly newsletter with the top 5 articles worth reading every week.

More from Krzysztof Kowalczyk blog

SumatraPDF new features: March 18, 2026

New in the SumatraPDF pre-release builds: DDE commands accept arguments Commands sent via DDE can take arguments, the same as in custom shortcuts (#5383). Loading message in tab While a document loads, its tab shows a “loading” message instead of the home page (#5385). Install 32-bit on 64-bit Windows The installer lets you install the 32-bit version on 64-bit Windows (#5379). Changes for this day · Full changelog

yesterday • 1 votes
Finding active GitHub forks from the command line

I maintain SumatraPDF on GitHub. People fork it and make their own changes. I want to know which forks are active and what they’re working on. GitHub has a Network tab for this. I find it lousy. It’s hard to see active forks at a glance. Panning and zooming the UI is slow and fiddly. I just want a sorted list of forks with actual changes. So I wrote a small script: github-active-forks.ts. What it does It uses the GitHub API to find forks that have ahead commits (changes not in upstream) from the last year. For each active branch it prints: a link to the branch on GitHub short sha, author, relative date, first line of commit message Forks are sorted by most recent activity, oldest first. Commits within a branch are oldest first. It compares each fork branch against the matching upstream branch (e.g. rel3.6working vs rel3.6working), not always master. That way you only see commits unique to the fork. How to run it Download the script: curl -O https://gist.githubusercontent.com/kjk/71a7679dd408d52bc612cdf5eecace58/raw/7d7f605dde6b739424e5190a79e3988477312e74/github-active-forks.ts You need Bun and the GitHub CLI logged in (gh auth login). Or set GITHUB_TOKEN. Run it on any repo as owner/repo: bun github-active-forks.ts sumatrapdfreader/sumatrapdf Progress goes to stderr; results go to stdout, so you can redirect to a file: bun github-active-forks.ts sumatrapdfreader/sumatrapdf > forks.txt Example output Excerpt from running on SumatraPDF (74 forks with ahead commits): https://github.com/wackget/sumatrapdf-Feldherren-version/tree/single-page-fit-scrollbar (289d ago) c53a51d wackget 294d ago Added scrollbar usable in Fit a Single Page display mode. f927640 wackget 294d ago scrollbar in single page mode now obeys the hideScrollbars setting. 7f57861 wackget 288d ago improved scrolling speed when zoomed in, in non-continuous single-page view. https://github.com/xyzzyx99/sumatrapdf/tree/rel3.6working (5d ago) c8d1f7b xyzzyx99 13d ago Add GitHub Actions workflow for building project 8a92547 xyzzyx99 13d ago Fix bugs, revert using version 3.6 1f27324 xyzzyx99 13d ago Save and restore CHM scroll position 24e7974 xyzzyx99 6d ago Preserve current CHM URL across tab restore 30b1cb4 xyzzyx99 5d ago Update README with new bug fixes and formatting https://github.com/lsq/sumatrapdf/tree/dev (today) 72d7069 lsq 11d ago feat: support share file via socket a1fc427 lsq 10d ago feat: open home page 938bc07 lsq today add localsend v2.1 api support Much easier to scan than the Network graph.

18th Jun 2026 • 1 votes
Speeding up JavaScript function with AI help

A new JavaScript library pretext for fast text measuring / layout popped up on social media. Potentially interesting given its focus on speeding up text rendering in web apps and me writing web apps and liking them being fast. I looked at the code and saw a function isCJK(). Given my 3 decades of programming and performance optimization, it looked like it could be sped up. This is a story about ideas on making JavaScript faster and the process of quickly implementing and benchmarking them. The code export function isCJK(s: string): boolean { for (const ch of s) { const c = ch.codePointAt(0)! if ((c >= 0x4E00 && c <= 0x9FFF) || (c >= 0x3400 && c <= 0x4DBF) || (c >= 0x20000 && c <= 0x2A6DF) || (c >= 0x2A700 && c <= 0x2B73F) || (c >= 0x2B740 && c <= 0x2B81F) || (c >= 0x2B820 && c <= 0x2CEAF) || (c >= 0x2CEB0 && c <= 0x2EBEF) || (c >= 0x30000 && c <= 0x3134F) || (c >= 0xF900 && c <= 0xFAFF) || (c >= 0x2F800 && c <= 0x2FA1F) || (c >= 0x3000 && c <= 0x303F) || (c >= 0x3040 && c <= 0x309F) || (c >= 0x30A0 && c <= 0x30FF) || (c >= 0xAC00 && c <= 0xD7AF) || (c >= 0xFF00 && c <= 0xFFEF)) { return true } } return false } My spider sense tingling To make code run fast you have to have mechanical sympathy. You need a good mental model of how CPUs and programming languages work, at the low level. Because I have mechanical sympathy, I know that to evaluate multiple || statements, the program has to check every statement until it finds one that is true. For the case of not matching any range, it has to do all 15 comparisons. My immediate thought was that most characters are ascii (non-cjk) and therefore require 15 comparisons. An early exit should speed things up: if (c < 0x300) continue;. It adds 1 comparison for matching cases but removes 14 (15 - 1) for the most common case of ascii characters. Hunch is good, benchmark is better Micro-benchmarking is subtle. In the past I would google for a JavaScript benchmarking library and trust that it’s sound. Claude wrote a sound, simple benchmark function: function bench(name, fn, iterations = 1_000_000) { for (let i = 0; i < 10_000; i++) fn(); // warmup const start = performance.now(); for (let i = 0; i < iterations; i++) fn(); const elapsed = performance.now() - start; const opsPerSec = ((iterations / elapsed) * 1000).toFixed(0); console.log(`${name}: ${elapsed.toFixed(2)} ms (${opsPerSec} ops/sec)`); } // to call: bench("isCJKRegex ", () => isCJKRegex(input)); The subtle part is warmup phase. JavaScript JIT engines that you’re likely to use (v8 in Chrome, JavaScriptCore in Safari, SpiderMonkey in FireFox) have several optimization tiers and only do most aggressive optimization for frequently called functions. The warmup phase forces JIT to compile fn with most aggressive settings. This is only fair - I assume isCJK is called frequently. If it wasn’t, there’s no point sweating to optimize it. The new AI normal In the past I would have to manually implement each optimization idea. With AI I can delegate the coding and therefore test more ideas. The following was done with Claude 4.6. 100% vibe coding There are levels of delegating things to AI. On the extreme side of giving up control is 100% vibe coding. I had 2 ideas for performance optimization: early exit replace 15 linear checks with binary search But what if I didn’t? What if I just ask AI to come up with ideas? The following is my conversation with Claude 4.6 and what I’ve learned. I created is_cjk.js file and pasted the original function. look at is_cjk.js. come up with 2 ideas for how to speed up isCJK(). Implement those as separate functions and write a javascript micro-benchmark that compares those 2 new implementations against isCJK Two ideas: Pre-compiled regex — push the entire check into the native regex engine, avoiding JS-level for…of iteration and codePointAt() overhead. Typed array bitmap for BMP — for BMP characters (the vast majority of real text), a Uint8Array bitmap gives O(1) lookup with a single array access. Fall back to range checks only for supplementary plane characters. I have to admit: I recognize those as valid optimization ideas but they didn’t immediately occur to me. Regex works because regex implementations in JavaScript engines are insanely optimized. Bitmap is a known optimization for doing true/false lookup for numbers. Let’s say you have total range 0-255 and you want a function that checks if a number is in range 1-10, 20-30, 40-50, 60-70, 80-90. That’s 5 if statements, each doing 2 comparisons. You can instead use 1 bit for each of the 256 numbers (i.e. 256⁄8 = 32 bytes), pre-compute the array of bytes and set the bit for the ranges. Then lookup is just math to get byte offset and bit, load the byte, check the bit. Super fast. Claude not only wrote the benchmark function, 2 new implementations but also ran the benchmarks using node and showed me results in a readable way. The bitmap approach was significantly faster. Human assisted coding Bitmap was the fastest and yet I discarded it using my human judgement. The bitmap needed 65kB of memory and that’s just too much for this function. That’s where human judgement comes in to improve collaboration with AI. I didn’t specify that I also care about memory usage so AI wrote fast code that was using too much memory. You’re benchmarking what? Here’s another tricky part of benchmarking: knowing what you benchmark. There are 3 popular JavaScript engines. Claude ran benchmarks using node which uses Chrome’s v8. That’s good because that’s the most popular browser and therefore most popular JavaScript JIT engine. It’s also good to sanity-check with at least one other JavaScript engine. bun uses Safari’s JavaScriptCore so I asked Claude: run the tests using bun The results were similar, which is good. We don’t want code that is fast in one engine but slow in another. We don’t control which browser the user of our code is running. Continuing collaboration with AI I had some more ideas so here’s the rest of my conversation with Claude. don’t benchmark bitmap, it uses too much memory; write a variant of isCJK that does an early false exit if char is less than smallest Early exit is my first insight I wanted to test. As expected, early exit is good 2x speedup for latin strings, although regex beats it on cjk strings. That is the curse of engineering trade-offs: you have to decide if you want to optimize for cjk strings or non-cjk strings. now implement a variant that does inline bisect / binary search That was my second idea: do a binary search instead of sequential if comparisons. It was faster than original but slower than regex / early exit. Also, Claude didn’t do what I meant. It stored the ranges as array: // Flat array: [lo0, hi0, lo1, hi1, ...] sorted by lo const cjkRanges = new Uint32Array([ 0x3000, 0x303f, 0x3040, 0x309f, ... That’s what I meant: implement a variant isCJBisect that doesn’t use array but unrolls binary search logic into if statements The implementation is gnarly: function inCJKUnrolled(c) { if (c < 0x3000) return false; if (c < 0xff00) { if (c < 0x3400) { if (c < 0x3040) { return c <= 0x303f; } else if (c > 0x309f) { return c >= 0x30a0 && c <= 0x30ff; } return true; // ... more gnarly code But what do I care? Claude wrote it. Arguably it’s hard for me to review for correctness but it’s perfectly testable. We can write a test to compare if it returns the same result as original function for every possible input. As expected, unrolled version was faster than array-based but not always faster than regex or early exit. But Claude wrote something that caught my eye: The for…of + codePointAt iterator overhead remains the bottleneck shared by all non-regex variants on long strings. It’s well known that for ... of loop is slower than for (let i = 0; i < n; i++). It’s one of those things that you need to know. I knew this but I didn’t connect the dots in this particular case. write variant of isCJKEarly which replaces for of with a faster loop Result: isCJKEarlyFast crushes everything across the board on both runtimes The code for isCKJEarlyFast. Looks like we have a winner: Replacing for…of + codePointAt() with charCodeAt() + index loop eliminates the iterator overhead, which was the main bottleneck. The early c < 0x3000 bail then skips all range checks for ASCII/latin characters cheaply. Only regex still wins on Node’s long latin miss case thanks to V8’s native string scanning. There’s a subtlety that makes the rewrite of for .. of into for (let i = 0; i < n; i++) tricky. Logically JavaScript strings are composed from 16-bit numbers (characters). Some Unicode code-points are bigger than 16-bit and are stored as 2 16-bit numbers, called surrogate pairs. So writing a loop over unicode codepoints needs to take this into account. It’s tricky code but again, what do I care? Claude wrote it and it’s perfectly testable. Pressing on The good thing about claude writing most of the code and removing other tedium like running the benchmarks is that we can do more in the same amount of time. So I explored even more. I noticed: export function isCJKUnrolled(s) { for (const ch of s) { if (inCJKUnrolled(ch.codePointAt(0))) return true; } return false; } What happens when inCJKUnrolled is inlined? inline inCJKUnrolled into isCJKUnrolled Result: Done. Inlining didn’t help — it actually got slightly slower in most cases (the engine was already inlining the small function). No change in rankings; EarlyFast remains the winner. Turns out it’s not faster, which was surprising. Inlining is supposed to remove overhead of function calls, which matters in loops. Surprising isn’t bad. We run benchmarks to validate our hunches. For completness, I wanted to compare with original where for .. of was rewritten. also write original with for of replaced by standard for loop and bench all and give results as markdown table Claude was nice enough to show benchmark results in a nicely formatted table, without me even asking. It just knows things. But as you can see above, you can ask it for results in markdown table to e.g. include in a GitHub bug report. Here are final results. The number is operations/second in millions. Higher is better. Bun Scenario Original Regex Early Bisect Unrolled EarlyFast ForLoop Single CJK 11M 22M 12M 12M 16M 79M 57M Single latin 20M 24M 49M 21M 22M 40M 36M CJK string 12M 18M 17M 12M 14M 42M 42M Latin string 1.5M 4.7M 3.6M 3.0M 3.5M 17M 6.5M Mixed string 6.5M 5.9M 9.9M 8.6M 13M 62M 34M Node Scenario Original Regex Early Bisect Unrolled EarlyFast ForLoop Single CJK 85M 54M 51M 44M 56M 112M 110M Single latin 59M 72M 83M 55M 74M 115M 103M CJK string 79M 55M 60M 55M 64M 90M 129M Latin string 4.2M 57M 4.3M 2.8M 4.5M 12M 8.3M Mixed string 14M 15M 16M 10M 15M 41M 38M Conclusions AI is a big unlock. It took me under 30 minutes to test various hypotheses and find out a significant speed up. Without Claude it would take several hours and I would likely not do it at all. It’s just not important enough to spend a working day on it. To get best results we still need to apply human judgement and guide the AI. Programming expert knowledge An expert is simply someone who knows things. We know things because we learn them. If you were paying attention you might have learned the following things: importance of warmup phase when benchmarking JIT compilers for .. of is slower than for (let i = 0; i < n; i++) regex matching in JavaScript engines is fast subtlety of surrogate pairs in JavaScript strings using bitmaps to speed up range lookups Resources All the code is in https://gist.github.com/kjk/bdbea9d90c3bb0454fbe26353c521bfd I like to write fast code. If you want a fast bookmark manager / note taker, try MarkLexis. If you want a fast PDF / ebook / comic book reader for Windows, try SumatraPDF.

29th Mar 2026 • 1 votes
How to run msvc cl.exe from command-line (powershell)

So you’ve installed Visual Studio and you want to run the compiler cl.exe from command-line. Microsoft makes it surprisingly hard. They give you a shortcut which opens a terminal window with cmd.exe setup for compilation. But I don’t want a separate window, I want to use the terminal app. You can run cmd.exe /k "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 (location for your setup can be different). But I don’t want to run inside cmd.exe. I want to use powershell. What exactly does vcvarsall.bat do? Not much: it just sets some env variables and updates PATH. We can reverse-engineer what it does: cmd.exe set >before.txt cmd.exe /k "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 set >after.txt Now compare before.txt and after.txt to see what changed. I asked AI to do it for me and here’s the beginning of what I found: CommandPromptType=Native DevEnvDir=C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\ ExtensionSdkDir=C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs EXTERNAL_INCLUDE=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\include;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\ATLMFC\include;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.26100.0\ucrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\um;C:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\shared;C:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\winrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\cppwinrt;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um Framework40Version=v4.0 FrameworkDir=C:\Windows\Microsoft.NET\Framework64\ FrameworkDir64=C:\Windows\Microsoft.NET\Framework64\ ... more stuff I saved that to diff.txt file. Now that we have that we can ask our friendly AI to convert this to a powershell function: write powershell function that sets variables as seen in @diff.txt I get something like this: function set-msvc { <# .SYNOPSIS Sets Visual Studio Developer Command Prompt environment variables. .DESCRIPTION This function sets all the environment variables needed for Visual Studio 2022 native x64 development, equivalent to running vcvars64.bat. .EXAMPLE Set-VsDevEnv #> [CmdletBinding()] param() $env:CommandPromptType = "Native" $env:DevEnvDir = "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\" ... more stuff We need to change one thing: $env::PATH from absolute to just adding paths to current $env::PATH so that it’ll adapt to future changes in PATH. Now add that to $PROFILE and you can type set-msvc to setup powershell to have access to cl.exe, msbuild and other tools. Below is the whole function but note that this is only for amd64 toolset. For 32-bit or arm setup would be different. You can get by re-running the above logic for vcvarsall.bat with different arguments. function set-msvc { <# .SYNOPSIS Sets Visual Studio Developer Command Prompt environment variables. .DESCRIPTION This function sets all the environment variables needed for Visual Studio 2022 native x64 development, equivalent to running vcvars64.bat. .EXAMPLE Set-VsDevEnv #> [CmdletBinding()] param() $env:CommandPromptType = "Native" $env:DevEnvDir = "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\" $env:ExtensionSdkDir = "C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs" $env:EXTERNAL_INCLUDE = "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\include;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\ATLMFC\include;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.26100.0\ucrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\um;C:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\shared;C:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\winrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\cppwinrt;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" $env:Framework40Version = "v4.0" $env:FrameworkDir = "C:\Windows\Microsoft.NET\Framework64\" $env:FrameworkDir64 = "C:\Windows\Microsoft.NET\Framework64\" $env:FrameworkVersion = "v4.0.30319" $env:FrameworkVersion64 = "v4.0.30319" $env:FSHARPINSTALLDIR = "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\FSharp\Tools" $env:HTMLHelpDir = "C:\Program Files (x86)\HTML Help Workshop" $env:INCLUDE = "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\include;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\ATLMFC\include;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.26100.0\ucrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\um;C:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\shared;C:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\winrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\cppwinrt;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" $env:is_x64_arch = "true" $env:LIB = "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\ATLMFC\lib\x64;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\lib\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.26100.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\\lib\10.0.26100.0\\um\x64" $env:LIBPATH = "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\ATLMFC\lib\x64;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\lib\x64;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\lib\x86\store\references;C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.26100.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.26100.0;C:\Windows\Microsoft.NET\Framework64\v4.0.30319" $env:NETFXSDKDir = "C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\" $env:Path = "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\bin\HostX64\x64;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\VC\VCPackages;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\bin\Roslyn;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\;C:\Program Files (x86)\HTML Help Workshop;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\FSharp\Tools;C:\Program Files\Microsoft Visual Studio\2022\Community\Team Tools\DiagnosticsHub\Collector;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\Llvm\x64\bin;C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\\x64;C:\Program Files (x86)\Windows Kits\10\bin\\x64;C:\Program Files\Microsoft Visual Studio\2022\Community\\MSBuild\Current\Bin\amd64;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\;" + $env::Path + ";C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\VC\Linux\bin\ConnectionManagerExe;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\vcpkg" $env:Platform = "x64" $env:UCRTVersion = "10.0.26100.0" $env:UniversalCRTSdkDir = "C:\Program Files (x86)\Windows Kits\10\" $env:VCIDEInstallDir = "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\VC\" $env:VCINSTALLDIR = "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\" $env:VCPKG_ROOT = "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\vcpkg" $env:VCToolsInstallDir = "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\" $env:VCToolsRedistDir = "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.44.35112\" $env:VCToolsVersion = "14.44.35207" $env:VisualStudioVersion = "17.0" $env:VS170COMNTOOLS = "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\" $env:VSCMD_ARG_app_plat = "Desktop" $env:VSCMD_ARG_HOST_ARCH = "x64" $env:VSCMD_ARG_TGT_ARCH = "x64" $env:VSCMD_VER = "17.14.24" $env:VSINSTALLDIR = "C:\Program Files\Microsoft Visual Studio\2022\Community\" $env:WindowsLibPath = "C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.26100.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.26100.0" $env:WindowsSdkBinPath = "C:\Program Files (x86)\Windows Kits\10\bin\" $env:WindowsSdkDir = "C:\Program Files (x86)\Windows Kits\10\" $env:WindowsSDKLibVersion = "10.0.26100.0\" $env:WindowsSdkVerBinPath = "C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\" $env:WindowsSDKVersion = "10.0.26100.0\" $env:WindowsSDK_ExecutablePath_x64 = "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\" $env:WindowsSDK_ExecutablePath_x86 = "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\" $env:__DOTNET_ADD_64BIT = "1" $env:__DOTNET_PREFERRED_BITNESS = "64" $env:__VSCMD_PREINIT_PATH = "C:\Program Files\PowerShell\7;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Microsoft VS Code\bin;c:\Users\kjk\AppData\Local\Programs\cursor\resources\app\bin;C:\Program Files\gs\gs10.03.1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\GitHub CLI\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\Rust stable MSVC 1.88\bin;C:\Program Files\PowerShell\7\;C:\Program Files\nodejs\;C:\Program Files\dotnet\;C:\Program Files\CMake\bin;C:\Program Files\Go\bin;C:\Program Files\RedHat\Podman\;C:\Program Files\Tailscale\;C:\Program Files\Git\cmd;C:\Program Files\Docker\Docker\resources\bin;C:\Users\kjk\AppData\Local\Microsoft\WindowsApps;C:\Users\kjk\AppData\Local\Microsoft\WinGet\Links;C:\Users\kjk\.bun\bin;C:\Users\kjk\.dotnet\tools;C:\Users\kjk\go\bin;C:\Users\kjk\AppData\Local\Programs\superfile\;C:\Users\kjk\AppData\Local\Microsoft\WindowsApps;C:\Users\kjk\AppData\Local\GitHubDesktop\bin;C:\Users\kjk\AppData\Local\Programs\cursor\resources\app\bin;C:\Users\kjk\AppData\Roaming\npm;C:\Users\kjk\.dotnet\tools;C:\Users\kjk\AppData\Local\Programs\Antigravity\bin;C:\Users\kjk\AppData\Local\Programs\Zed\bin;C:\Users\kjk\go\bin;C:\Users\kjk\OneDrive\bin;C:\Users\kjk\.bin\jai\bin;C:\Users\kjk\.bin\mupdf-1.27.0;C:\Users\kjk\.local\bin;C:\Users\kjk\AppData\Local\Programs\WinMerge;C:\Users\kjk\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\Scripts;C:\Users\kjk\OneDrive\bin\sublime_text" Write-Host "Visual Studio 2022 Developer Environment configured for x64." -ForegroundColor Green }

16th Jan 2026 • 1 votes

More in programming

A new home for all my apps: apps.chofter.com

Say hello to apps.chofter.com, the new home for everything I build. The speed at which I ship new things has massively increased with the advent of AI, and I’ve been encouraged by the fact that, as I approach my sixth decade, new ideas for useful & fun things to build still come at me apace. These no longer fit on my personal homepage, which is a combination of work experience, interests, things I made long ago that are no longer relevant (but still interesting), and of course, the many apps & tools I have out there in the wild right now. The site was 100% built using Claude Code, which did an amazing job of inspecting all the various websites, app stores and code bases and constructing a site in 30 minutes or so. I had to push it to make the site more SEO friendly, pre-rendered to HTML rather than over relying on client side rendering, but that was it. So there we go, enjoy the delightful and hopefully useful apps that I’ve already built and will continue to build in the future

12 hours ago • 1 votes
SumatraPDF new features: March 18, 2026

New in the SumatraPDF pre-release builds: DDE commands accept arguments Commands sent via DDE can take arguments, the same as in custom shortcuts (#5383). Loading message in tab While a document loads, its tab shows a “loading” message instead of the home page (#5385). Install 32-bit on 64-bit Windows The installer lets you install the 32-bit version on 64-bit Windows (#5379). Changes for this day · Full changelog

yesterday • 1 votes
An Update on Orion for Linux and Windows

Kagi is ending development of Orion for Linux and Windows and open-sourcing both so the community can carry them forward. Our small team will now focus fully on making Orion for macOS and iOS faster, more stable, and more capable.

2 days ago • 1 votes
Clip of me singing Despard in Ruddigore in 2013

A clip of me singing a funny song from Gilbert and Sullivan’s Ruddigore back in 2013

2 days ago • 1 votes
How and Why fork() Uses Copy-on-Write

In this video, we look at why fork() needs copy-on-write, how it works inside the kernel, and a memory usage problem that Instagram encountered with Python.

2 days ago • 1 votes
📚 BoredReading

You seem to be enjoying this.

Join free to unlock everything.

Create free account

Already have an account? Sign in