TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Speeding up Floyd-Steinberg dithering: an optimization exercise

2 点作者 itamarst超过 1 年前

1 comment

cprogrammer1994超过 1 年前
Hi I shaved off 40% more just by replacing multiplication with bitwise operations and ported the code to a standard Python C Extension to avoid relying on JIT.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;szabolcsdombi&#x2F;optimized-floyd-steinberg-dithering">https:&#x2F;&#x2F;github.com&#x2F;szabolcsdombi&#x2F;optimized-floyd-steinberg-d...</a><p>X * 7 is equal to (X &lt;&lt; 3) - X<p>X * 3 is equal to (X &lt;&lt; 1) + X<p>X * 5 is equal to (X &lt;&lt; 2) + X