<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>C on McGinnis, Will</title>
    <link>https://mcginniscommawill.com/tags/c/</link>
    <description>Recent content in C on McGinnis, Will</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Wed, 17 Jun 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://mcginniscommawill.com/tags/c/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Into the C: Making PyGeoHash Decode Twice as Fast</title>
      <link>https://mcginniscommawill.com/posts/2026-06-17-pygeohash-c-extension-decode/</link>
      <pubDate>Wed, 17 Jun 2026 00:00:00 +0000</pubDate>
      <guid>https://mcginniscommawill.com/posts/2026-06-17-pygeohash-c-extension-decode/</guid>
      <description>&lt;p&gt;This is the third post in a small thread about PyGeoHash performance. First I &lt;a href=&#34;https://mcginniscommawill.com/posts/2026-06-03-benchmarking-pygeohash-speed/&#34;&gt;benchmarked it against the field&lt;/a&gt;, then I &lt;a href=&#34;https://mcginniscommawill.com/posts/2026-06-10-optimizing-pygeohash-wrapper-overhead/&#34;&gt;trimmed the Python wrapper&lt;/a&gt; that sat in front of the C extension. That wrapper work got encode within a hair of the C++ &lt;code&gt;python-geohash&lt;/code&gt; library. But decode was still about four times slower, and I had already established that the slow part lived in the C extension itself. So this time I opened up the C.&lt;/p&gt;&#xA;&lt;p&gt;I expected to be staring at floating point math and bit twiddling, looking for a clever trick. What I actually found was a function building objects it threw away and importing the same Python module twice on every single call. The fix made decode 67% faster and did not touch the geohash algorithm at all.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
