<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Hacker News: benjoffe</title><link>https://news.ycombinator.com/user?id=benjoffe</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Thu, 29 Oct 2026 11:45:14 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=benjoffe" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by benjoffe in "A new faster algorithm to compute 64-bit signed floor division"]]></title><description><![CDATA[
<p>Hello, you are correct that part of it is done to death for standard integer division.<p>The `new` thing is the range-splitting which achieves the floor division for negative inputs (eg. sign-selected for 60% of divisors, and the negative/positive bump for the remaining 20%/20% of cases each).</p>
]]></description><pubDate>Thu, 29 Oct 2026 07:02:07 +0000</pubDate><link>https://news.ycombinator.com/item?id=50285413</link><dc:creator>benjoffe</dc:creator><comments>https://news.ycombinator.com/item?id=50285413</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50285413</guid></item><item><title><![CDATA[A new faster algorithm to compute 64-bit signed floor division]]></title><description><![CDATA[
<p>Article URL: <a href="https://www.benjoffe.com/fast-floordiv">https://www.benjoffe.com/fast-floordiv</a></p>
<p>Comments URL: <a href="https://news.ycombinator.com/item?id=50256409">https://news.ycombinator.com/item?id=50256409</a></p>
<p>Points: 88</p>
<p># Comments: 5</p>
]]></description><pubDate>Tue, 27 Oct 2026 09:13:12 +0000</pubDate><link>https://www.benjoffe.com/fast-floordiv</link><dc:creator>benjoffe</dc:creator><comments>https://news.ycombinator.com/item?id=50256409</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50256409</guid></item><item><title><![CDATA[Show HN: A Zoomable Equal-Area Map Projection that interpolates to Mercator]]></title><description><![CDATA[
<p>Article URL: <a href="https://www.benjoffe.com/map">https://www.benjoffe.com/map</a></p>
<p>Comments URL: <a href="https://news.ycombinator.com/item?id=49710096">https://news.ycombinator.com/item?id=49710096</a></p>
<p>Points: 5</p>
<p># Comments: 0</p>
]]></description><pubDate>Tue, 15 Sep 2026 09:58:15 +0000</pubDate><link>https://www.benjoffe.com/map</link><dc:creator>benjoffe</dc:creator><comments>https://news.ycombinator.com/item?id=49710096</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49710096</guid></item><item><title><![CDATA[A faster way to convert a timestamp to Hour, Min, Sec]]></title><description><![CDATA[
<p>Article URL: <a href="https://www.benjoffe.com/fast-time-of-day">https://www.benjoffe.com/fast-time-of-day</a></p>
<p>Comments URL: <a href="https://news.ycombinator.com/item?id=49596678">https://news.ycombinator.com/item?id=49596678</a></p>
<p>Points: 9</p>
<p># Comments: 0</p>
]]></description><pubDate>Mon, 07 Sep 2026 10:47:42 +0000</pubDate><link>https://www.benjoffe.com/fast-time-of-day</link><dc:creator>benjoffe</dc:creator><comments>https://news.ycombinator.com/item?id=49596678</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49596678</guid></item><item><title><![CDATA[New comment by benjoffe in "A faster way to calculate the day of the week"]]></title><description><![CDATA[
<p>Thanks for sharing that.<p>I have a mobile-friendly web-app where you can practice this technique, just click the link in the page's nav: "Weekle - Weekday Guessing Game"</p>
]]></description><pubDate>Thu, 20 Aug 2026 07:05:51 +0000</pubDate><link>https://news.ycombinator.com/item?id=49371384</link><dc:creator>benjoffe</dc:creator><comments>https://news.ycombinator.com/item?id=49371384</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49371384</guid></item><item><title><![CDATA[New comment by benjoffe in "A faster way to calculate the day of the week"]]></title><description><![CDATA[
<p>Thanks! I'm pretty sure with this one I spent more time working on the blog post than I did developing the algorithms.<p>I would not normally spend such effort, but in this case I felt that the functions were too hard to understand without the visual aid, and too difficult to customise without the Function Explorer.<p>Then I think I just got a bit carried away with the detail.</p>
]]></description><pubDate>Mon, 17 Aug 2026 22:15:55 +0000</pubDate><link>https://news.ycombinator.com/item?id=49338407</link><dc:creator>benjoffe</dc:creator><comments>https://news.ycombinator.com/item?id=49338407</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49338407</guid></item><item><title><![CDATA[A new 2-3x faster algorithm for computing day-of-week]]></title><description><![CDATA[
<p>Article URL: <a href="https://www.benjoffe.com/fast-day-of-week">https://www.benjoffe.com/fast-day-of-week</a></p>
<p>Comments URL: <a href="https://news.ycombinator.com/item?id=49328331">https://news.ycombinator.com/item?id=49328331</a></p>
<p>Points: 5</p>
<p># Comments: 0</p>
]]></description><pubDate>Mon, 17 Aug 2026 09:27:15 +0000</pubDate><link>https://www.benjoffe.com/fast-day-of-week</link><dc:creator>benjoffe</dc:creator><comments>https://news.ycombinator.com/item?id=49328331</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49328331</guid></item><item><title><![CDATA[New comment by benjoffe in "A faster is_leap_year function (full-range, C++)"]]></title><description><![CDATA[
<p>Correct URL: <a href="https://www.benjoffe.com/fast-leap-year" rel="nofollow">https://www.benjoffe.com/fast-leap-year</a><p>(The link in the submission is incorrect; apologies for the confusion.)</p>
]]></description><pubDate>Thu, 11 Dec 2025 23:30:04 +0000</pubDate><link>https://news.ycombinator.com/item?id=46238835</link><dc:creator>benjoffe</dc:creator><comments>https://news.ycombinator.com/item?id=46238835</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=46238835</guid></item><item><title><![CDATA[New comment by benjoffe in "A faster is_leap_year function (full-range, C++)"]]></title><description><![CDATA[
<p>In this article I present a new faster <i>full-range</i> function to calculate whether a year is a leap year. This type of calculation is a fundamental date library utility, it is used all over the place: validating and parsing dates, determining the Nth last weekday of a month, handling month overflow/underflow when adjusting the day, etc.<p>The article outlines the technique, shows related developments before and after its creation, and includes an interactive, human-verifiable "proof".</p>
]]></description><pubDate>Thu, 11 Dec 2025 23:26:27 +0000</pubDate><link>https://news.ycombinator.com/item?id=46238802</link><dc:creator>benjoffe</dc:creator><comments>https://news.ycombinator.com/item?id=46238802</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=46238802</guid></item><item><title><![CDATA[A faster is_leap_year function (full-range, C++)]]></title><description><![CDATA[
<p>Article URL: <a href="https://www.benjoffe.com/fast-date">https://www.benjoffe.com/fast-date</a></p>
<p>Comments URL: <a href="https://news.ycombinator.com/item?id=46238801">https://news.ycombinator.com/item?id=46238801</a></p>
<p>Points: 2</p>
<p># Comments: 2</p>
]]></description><pubDate>Thu, 11 Dec 2025 23:26:27 +0000</pubDate><link>https://www.benjoffe.com/fast-date</link><dc:creator>benjoffe</dc:creator><comments>https://news.ycombinator.com/item?id=46238801</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=46238801</guid></item><item><title><![CDATA[New comment by benjoffe in "A Fast 64-Bit Date Algorithm (30–40% faster by counting dates backwards)"]]></title><description><![CDATA[
<p>That is an interesting question.<p>It might also come into play if developing SIMD alternatives for batch date processing, as one can have more lanes with 16-bit. I plan to make a blog post covering SIMD and if 16-bit algorithms have reasonable performance then that will be covered.</p>
]]></description><pubDate>Thu, 27 Nov 2025 23:10:46 +0000</pubDate><link>https://news.ycombinator.com/item?id=46074001</link><dc:creator>benjoffe</dc:creator><comments>https://news.ycombinator.com/item?id=46074001</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=46074001</guid></item><item><title><![CDATA[New comment by benjoffe in "A Fast 64-Bit Date Algorithm (30–40% faster by counting dates backwards)"]]></title><description><![CDATA[
<p>Thanks, that is a good idea. This was originally a blog post series, and the first article gave a bit of an introduction.<p>When I started the blog series, I expected the first article to be the most noteworthy, with the 2nd and 3rd being lesser supplementary topics.<p>Now that the 3rd blog post ended up with a much larger result than I was expecting, it stands on its own and could do with some editing as you suggest.</p>
]]></description><pubDate>Thu, 27 Nov 2025 23:06:36 +0000</pubDate><link>https://news.ycombinator.com/item?id=46073983</link><dc:creator>benjoffe</dc:creator><comments>https://news.ycombinator.com/item?id=46073983</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=46073983</guid></item><item><title><![CDATA[New comment by benjoffe in "A Fast 64-Bit Date Algorithm (30–40% faster by counting dates backwards)"]]></title><description><![CDATA[
<p>The first article in this blog post series has a little section talking briefly about this history, and there's a representation of this that I think sheds a lot of light on the original design. See the heading "Side-Note on Month / Day Determination" in the below link [1].<p>Displaying the months like the following helps see the regularity at a glance. Columns 1, 3 and 5 are the long months, others being shorter:<p><pre><code>  +-----+-----+-----+-----+-----+
  | 31  | 30  | 31  | 30  | 31  |
  |  I  | II  | III | IV  |  V  |
  | MAR | APR | MAY | JUN | JUL |
  |-----+-----+-----+-----+-----+
  | 31  | 30  | 31  | 30  | 31  |
  | VI  |VII  |VIII | IX  |  X  |
  | AUG | SEP | OCT | NOV | DEC |
  +-----+-----+-----+-----+-----+
  | 31  |28/29|
  | XI  |XII  |
  | Jan | FEB |
  +-----+-----+
</code></pre>
> To a person who natively thinks in Roman numerals, remembering that the short months are: II, VII, XII, along with IV & IX would be much easier than the way us modern folks have to memorise it.<p>[1] <a href="https://www.benjoffe.com/fast-date" rel="nofollow">https://www.benjoffe.com/fast-date</a></p>
]]></description><pubDate>Thu, 27 Nov 2025 23:02:18 +0000</pubDate><link>https://news.ycombinator.com/item?id=46073954</link><dc:creator>benjoffe</dc:creator><comments>https://news.ycombinator.com/item?id=46073954</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=46073954</guid></item><item><title><![CDATA[New comment by benjoffe in "A Fast 64-Bit Date Algorithm (30–40% faster by counting dates backwards)"]]></title><description><![CDATA[
<p>Thanks.<p>I was fortunate enough to be programming on an ARM based device, which meant that the terms (x * 4 + 3) strongly stood out to me as highly inefficient, being 2 cycle prep for the more important division. On x64 computers, those two operations are calculated in only one operation by using the 'LEA' assembly instruction (which I wasn't aware of at the time), and so others using that type of computer might not have felt this step needed any simplification.<p>I tried everything under the sun to get rid of these steps. The technique noted in the article of using the year 101 BC was for a long time my strongest candidate, you can view the implementation of that attempt at the link below [1].<p>An epoch of 101 BC still meant that there was extra work required to re-normalise the timeline after the century calculation, but it was only a single addition of 365 in the calculation of `jul`. The explanation of how this works is probably a whole blog post in itself, but now that this algorithm has been discarded it's not worth the time to explain it fully.<p>I also had the year-modulus-bitshift technique developed at that time, but it couldn't be integrated cleanly with any of my algorithm attempts yet. My plan was to simply document it as an interesting but slower concept.<p>I don't know what sparked the idea of going backwards other than immersing myself deeply in the problem in my spare time for about a month. It finally came to me one evening, and I thought it was only going to save 1-cycle, but when it also meant the year-modulus-bitshift could be utilised, the entire thing fit together like a glove and the speed collapsed down from 20% time saving to 40%.<p>[1] <a href="https://github.com/benjoffe/fast-date-benchmarks/blob/218356e28c7d8d9d2b5986a2aa642bf829494236/algorithms/joffe_fast64bit.hpp" rel="nofollow">https://github.com/benjoffe/fast-date-benchmarks/blob/218356...</a></p>
]]></description><pubDate>Thu, 27 Nov 2025 22:50:48 +0000</pubDate><link>https://news.ycombinator.com/item?id=46073866</link><dc:creator>benjoffe</dc:creator><comments>https://news.ycombinator.com/item?id=46073866</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=46073866</guid></item><item><title><![CDATA[Show HN: A faster day-count to Y,M,D algorithm – 30-40% speedup]]></title><description><![CDATA[
<p>Converting that integer to a Year, Month and Day is a fundamental calculation made in almost all programming languages and standard libraries. It runs every time a date is displayed, whether it's in a user interface, log, API etc.<p>While it is rarely a bottleneck, it is a very frequently run algorithm, and thus has attracted a lot of attention over the years.<p>In 2021, Cassio Neri and Lorenz Schneider developed the Neri-Schneider algorithm, which was a major breakthrough in this niche area.<p>Lately, I have been studying this function deeply, and found what I believe may be the last remaining substantial improvements achievable on current hardware. The gains come mainly from counting dates backwards, and from reducing the number of multiplications from 7 to 4.<p>Adoption will depend on whether library maintainers consider the performance benefit to outweigh the readability. If this is rejected on readability grounds, then in those cases my algorithm outlined in Article 1 (linked in the blog post navigation) is likely to be simpler and faster than what almost all existing libraries are currently doing.<p>I found this a very interesting challenge to work on, and I believe some of the techniques outlined may be applicable to other areas of optimisation.</p>
<hr>
<p>Comments URL: <a href="https://news.ycombinator.com/item?id=46040319">https://news.ycombinator.com/item?id=46040319</a></p>
<p>Points: 3</p>
<p># Comments: 0</p>
]]></description><pubDate>Mon, 24 Nov 2025 22:47:02 +0000</pubDate><link>https://www.benjoffe.com/fast-date-64</link><dc:creator>benjoffe</dc:creator><comments>https://news.ycombinator.com/item?id=46040319</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=46040319</guid></item><item><title><![CDATA[New comment by benjoffe in "A Fast 64-Bit Date Algorithm (30–40% faster by counting dates backwards)"]]></title><description><![CDATA[
<p>A write-up of a new Gregorian date conversion algorithm.<p>It achieves a 30–40% speed improvement on x86-64 and ARM64 (Apple M4 Pro) by reversing the direction of the year count and reducing the operation count (4 multiplications instead of the usual 7+).<p>Paper-style explanation, benchmarks on multiple architectures, and full open-source C++ implementation.</p>
]]></description><pubDate>Sun, 23 Nov 2025 02:27:16 +0000</pubDate><link>https://news.ycombinator.com/item?id=46020194</link><dc:creator>benjoffe</dc:creator><comments>https://news.ycombinator.com/item?id=46020194</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=46020194</guid></item><item><title><![CDATA[A Fast 64-Bit Date Algorithm (30–40% faster by counting dates backwards)]]></title><description><![CDATA[
<p>Article URL: <a href="https://www.benjoffe.com/fast-date-64">https://www.benjoffe.com/fast-date-64</a></p>
<p>Comments URL: <a href="https://news.ycombinator.com/item?id=46020193">https://news.ycombinator.com/item?id=46020193</a></p>
<p>Points: 395</p>
<p># Comments: 94</p>
]]></description><pubDate>Sun, 23 Nov 2025 02:27:16 +0000</pubDate><link>https://www.benjoffe.com/fast-date-64</link><dc:creator>benjoffe</dc:creator><comments>https://news.ycombinator.com/item?id=46020193</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=46020193</guid></item><item><title><![CDATA[A New Faster Algorithm for Gregorian Date Conversion]]></title><description><![CDATA[
<p>Article URL: <a href="https://www.benjoffe.com/fast-date">https://www.benjoffe.com/fast-date</a></p>
<p>Comments URL: <a href="https://news.ycombinator.com/item?id=45796582">https://news.ycombinator.com/item?id=45796582</a></p>
<p>Points: 5</p>
<p># Comments: 1</p>
]]></description><pubDate>Mon, 03 Nov 2025 07:11:50 +0000</pubDate><link>https://www.benjoffe.com/fast-date</link><dc:creator>benjoffe</dc:creator><comments>https://news.ycombinator.com/item?id=45796582</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=45796582</guid></item><item><title><![CDATA[New comment by benjoffe in "The Smoital System – A method of timekeeping on Mars based on UTC"]]></title><description><![CDATA[
<p>This article dives deep into a topic I find very interesting, even if it’s not immediately useful.<p>If you don't have time to read, you may want to quickly check "Appendix A" for the “Smoitus” chart to see visually how the timezone alignment systems works, and "Section 5: Equation of Time (Smoital System)" to see how well this system tracks solar time.</p>
]]></description><pubDate>Tue, 26 Aug 2025 06:40:47 +0000</pubDate><link>https://news.ycombinator.com/item?id=45023055</link><dc:creator>benjoffe</dc:creator><comments>https://news.ycombinator.com/item?id=45023055</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=45023055</guid></item><item><title><![CDATA[The Smoital System – A method of timekeeping on Mars based on UTC]]></title><description><![CDATA[
<p>Article URL: <a href="https://www.benjoffe.com/smoitus">https://www.benjoffe.com/smoitus</a></p>
<p>Comments URL: <a href="https://news.ycombinator.com/item?id=45023054">https://news.ycombinator.com/item?id=45023054</a></p>
<p>Points: 2</p>
<p># Comments: 1</p>
]]></description><pubDate>Tue, 26 Aug 2025 06:40:47 +0000</pubDate><link>https://www.benjoffe.com/smoitus</link><dc:creator>benjoffe</dc:creator><comments>https://news.ycombinator.com/item?id=45023054</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=45023054</guid></item></channel></rss>