Skip to content

Commit 6012e17

Browse files
committed
Pointers to bencharray and CBQN source in primitive implementation README
1 parent cd82d0e commit 6012e17

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

docs/implementation/primitive/index.html

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ <h1 id="primitive-implementation-notes"><a class="header" href="#primitive-imple
1919
<li><a href="random.html">Randomness</a></li>
2020
<li><a href="types.html">Data types</a></li>
2121
</ul>
22+
<p>It may be helpful to read <a href="https://mlochbaum.github.io/bencharray/pages/summary.html">bencharray</a> measurements and commentary in conjunction with these notes. In addition to the implementations themselves, the <a href="https://github.com/dzaima/CBQN">CBQN</a> source code has comments at the top of many files in src/builtins/ that compactly list the methods used.</p>
2223
<p>Raw speed is of course the most important factor; I also consider predictability and memory usage to be important. Predictability mostly for the benefit of the programmer, but it's also important when there are multiple algorithms to be able to compute which one will be fastest. In some cases an algorithm is best on some subset of inputs, but is effectively useless because it's too difficult to tell if the input falls in that set. Whitney and other K users sometimes profess that binary size is critically important; I don't believe this.</p>
2324
<p>CBQN uses 1-byte, 2-byte, and 4-byte integers, 8-byte floats, and bit booleans. The various advantages of these types are discussed <a href="types.html">here</a>. We optimize for x86 and 64-bit ARM with vector extensions, focusing on AVX2 rather than AVX-512 because of the slow rollout of these wider instructions.</p>
2425
<p>It's difficult to know when better algorithms exist. I try to research the state of the art and to estimate how much room for improvement there is, but it will come as no surprise if I've completely overlooked something that's simple in hindsight, or postulated a lower bound that can be beaten with a clever trick.</p>

implementation/primitive/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Commentary on the best methods I know for implementing various primitives. Often
1515
- [Randomness](random.md)
1616
- [Data types](types.md)
1717

18+
It may be helpful to read [bencharray](https://mlochbaum.github.io/bencharray/pages/summary.html) measurements and commentary in conjunction with these notes. In addition to the implementations themselves, the [CBQN](https://github.com/dzaima/CBQN) source code has comments at the top of many files in src/builtins/ that compactly list the methods used.
19+
1820
Raw speed is of course the most important factor; I also consider predictability and memory usage to be important. Predictability mostly for the benefit of the programmer, but it's also important when there are multiple algorithms to be able to compute which one will be fastest. In some cases an algorithm is best on some subset of inputs, but is effectively useless because it's too difficult to tell if the input falls in that set. Whitney and other K users sometimes profess that binary size is critically important; I don't believe this.
1921

2022
CBQN uses 1-byte, 2-byte, and 4-byte integers, 8-byte floats, and bit booleans. The various advantages of these types are discussed [here](types.md). We optimize for x86 and 64-bit ARM with vector extensions, focusing on AVX2 rather than AVX-512 because of the slow rollout of these wider instructions.

0 commit comments

Comments
 (0)