Our great sponsors
-
is-even
Discontinued I created this in 2014, when I was learning how to program. (by i-voted-for-trump)
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
-
StringZilla
Up to 10x faster strings for C, C++, Python, Rust, and Swift, leveraging SWAR and SIMD on Arm Neon and x86 AVX2 & AVX-512-capable chips to accelerate search, sort, edit distances, alignment scores, etc 🦖
Easy enough to check with even the indecent compilers!
https://godbolt.org/
The actual implementation of this package is even better.
https://github.com/i-voted-for-trump/is-even/blob/master/ind...
(Click ... beside build to get assembly) https://play.rust-lang.org/?version=stable&mode=release&edit...
Unfortunately the go playground doesn't seem to support emitting assembly?
Jokes aside, lookup tables are a common technique to avoid costly operations. I was recently implementing one to avoid integer division. In my case I knew that the nominator and denominator were 8 bit unsigned integers, so I've replaced the division with 2 table lookups and 6 shifts and arithmetic operations [1]. The well known `libdivide` [2] does that for arbitrary 16, 32, and 64 bit integers, and it has precomputed magic numbers and lookup tables for all 16-bit integers in the same repo.
[1]: https://github.com/ashvardanian/StringZilla/blob/9f6ca3c6d3c...
Related posts
- Escape analysis hates copy elision (2021)
- Six times faster than C
- Examples of code playground/sandbox apps taken to the next level, how they work, and how far you would take a code playground site?
- John "God" Carmack: C++ with a C flavor is still the best (also: Python performance "keeps hitting me in the face")
- Ask HN: Which books/resources to understand modern Assembler?