Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
vitaut
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
1.
▲
by
vitaut
27d ago
The core of newer methods like yy, xjb and zmij is remarkably simple: https://vitaut.net/posts/2026/yy-dtoa/ . Shortest uscale is basically Schubfach or, rather, it's variant called Teju Jagua and has 2-3
2.
▲
A complete floating-point to_chars in 18 kB
(vitaut.net)
2 points
by
vitaut
29d ago
|
0 comments
3.
▲
The fastest double-to-string algorithm you've never heard of
(vitaut.net)
7 points
by
vitaut
1mo ago
|
0 comments
4.
▲
Regressive JPEGs
(maurycyz.com)
727 points
by
vitaut
2mo ago
|
69 comments
5.
▲
Open Access to Standards Documents
(discourse.llvm.org)
3 points
by
vitaut
4mo ago
|
1 comments
6.
▲
by
vitaut
4mo ago
Interviewer: Mr. Musk, I understand the wheels fell off the Cybertruck. Musk: Well, that’s not very typical. Most vehicles are designed so the wheels don’t fall off. Interviewer: But these ones did. Musk: Well obviously. That’s why we recal
7.
▲
by
vitaut
6mo ago
The binary bloat is also caused by unnecessary inlining and the linker eliminates most of it (but it's still annoying e.g. for godbolt). {fmt} supports a superset of std::format and std::print features including localization. stringstr
8.
▲
by
vitaut
6mo ago
std::print author here. Indeed, std::print shouldn't be expensive to compile, it's just a thin wrapper around a single type-erased function. The only reason why it is expensive in libstdc++ is that the type-erased function is inli
9.
▲
by
vitaut
8mo ago
Modules have been working reasonably well in clang for a while now but MSVC support is indeed buggy.
10.
▲
by
vitaut
8mo ago
This style is used in {fmt} and is great for documentation, especially on smaller screens: https://fmt.dev/12.0/api/#format_to_n
11.
▲
by
vitaut
8mo ago
We did see build time improvements from deploying modules at Meta.
12.
▲
Astrological CPU Scheduler
(github.com)
4 points
by
vitaut
8mo ago
|
0 comments
13.
▲
by
vitaut
8mo ago
The main effect of this is that some of the conversions between char and char8_t are inefficient.
14.
▲
Bitwise conversion of doubles using only FP multiplication and addition (2020)
(dougallj.wordpress.com)
57 points
by
vitaut
8mo ago
|
6 comments
15.
▲
by
vitaut
8mo ago
I was impressed how fast the Rust folks adopted this! Kudos to David Tolnay and others.
16.
▲
by
vitaut
8mo ago
Note that ~3-6ns is on modern desktop CPUs where extra few kB matter less. On microcontrollers it will be larger in absolute terms but I would expect the relative difference to also be moderate.
17.
▲
by
vitaut
8mo ago
I don't have exact numbers but from measuring perf changes per commit it seemed that most improvements came from "printing" (e.g. switching to BCD and SIMD, branchless exponent output) and microoptimizations rather than algor
18.
▲
by
vitaut
8mo ago
If you compress the table (see my earlier comment) and use plain Schubfach then you can get really small binary size and decent perf. IIRC Dragonbox with the compressed table was ~30% slower which is a reasonable price to pay and still fast
19.
▲
by
vitaut
8mo ago
It is possible to compress the table using the technique from Dragonbox ( https://github.com/fmtlib/fmt/blob/8b8fccdad40decf68687ec038... ) at the cost of some perf. It's on my TODO list for zmij.
20.
▲
by
vitaut
8mo ago
Note that it has the same table of powers of 10: https://github.com/rsc/fpfmt/blob/main/bench/uscalec/pow10.h
21.
▲
by
vitaut
8mo ago
Somewhat notable is that `char8_t` is banned with very reasonable motivation that applies to most codebases: > Use char and unprefixed character literals. Non-UTF-8 encodings are rare enough in Chromium that the value of distinguishing t
22.
▲
by
vitaut
8mo ago
The shortest double-to-string algorithm is basically Schubfach or, rather, it's variation Tejú Jaguá with digit output from Dragonbox. Schubfach is a beautiful algorithm: I implemented and wrote about it in https://vitaut.ne
23.
▲
by
vitaut
8mo ago
Other examples are CTRE ( https://github.com/hanickadot/compile-time-regular-expressio... ) and format string compilation ( https://fmt.dev/12.0/api/#compile-api ). The closest C counterpart is r
24.
▲
by
vitaut
8mo ago
It's easier to write faster code in a language with compile-time facilities such as C++ or Rust than in C. For example, doing this sort of platform-specific optimization in C is a nightmare https://github.com/vitaut
25.
▲
LLVM: The bad parts
(npopov.com)
389 points
by
vitaut
8mo ago
|
77 comments
26.
▲
by
vitaut
9mo ago
Please note that there is some error in your port: Error: roundtrip fail 4.9406564584124654e-324 -> '5.e-309' -> 4.9999999999999995e-309 Error: roundtrip fail 6.6302941479442929e-310 -> '6.6302941479443e-309' -&
27.
▲
by
vitaut
9mo ago
Yeah, that's what I meant.
28.
▲
by
vitaut
9mo ago
Should be fixed now.
29.
▲
by
vitaut
9mo ago
My bad, you are right. The small integer optimization should be switched to a different output method (or disabled since it doesn't provide much value). Thanks for catching this!
30.
▲
by
vitaut
9mo ago
I started a section to list implementations in other languages: https://github.com/vitaut/zmij?tab=readme-ov-file#other-lang... . Once yours is complete feel free to submit a PR to add it there.
More ›