Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Const-me
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
59 ms
·
781.
▲
by
Const-me
4y ago
It was years ago, but as far as I remember here's the hard parts. Efficient synchronization is hard. Tasks may spawn more tasks, i.e. the pool has multiple producers and consumers. With a few cores simple ways work fine, with a few doz
782.
▲
by
Const-me
4y ago
Writing a thread pool which is performant and scalable is surprisingly hard, I did couple times. And now, whenever I can, I tend to avoid doing that. Instead, I prefer using the stuff already implemented by someone else, in OS userlands or
783.
▲
by
Const-me
4y ago
Cool project! AFAIK many games are using 3x4 bone matrices instead of 4x4. These matrices don't need projection component anyway i.e. 3x4 is enough. This saves some bandwidth updating the constant buffer with them, also takes slightly
784.
▲
by
Const-me
4y ago
My comment was about my own use cases. As for students, I think repairability is even more important for them. Sometimes laptops are stolen or destroyed completely like dropped into the sea, for that they need to backup data. But I think th
785.
▲
by
Const-me
4y ago
The valuable data is backed up properly. And a laptop is usually a secondary computer i.e. there’s not much there to begin with. But I don’t like to lose any data at all if avoidable, no matter how unimportant that data is. I still keep VHD
786.
▲
by
Const-me
4y ago
I wouldn’t want a computer like that. I owned 4 laptops, got my first one in 2008. For all of them I have upgraded RAM and disks immediately after the purchase. For some of them upgraded SSDs after couple years of use: both speed and cost p
787.
▲
by
Const-me
4y ago
I agree about the scalar code, I know from experience JIT compilers can be awesome, sometimes they indeed outperform AOT. Automatic vectorization, on the other hand… Modern SIMD arrived in 1999, SSE1 in Pentium III. For the 20+ years which
788.
▲
by
Const-me
4y ago
I thing clang 13 has the best automatic vectorizer so far, yet it failed to do the job: https://godbolt.org/z/Y9796r1T1 This is despite unlike Java’s runtime, C++ compilers work offline, they don’t care too much about
789.
▲
by
Const-me
4y ago
Here’s an example of a simple C++ function, manually vectorized + unrolled for optimal performance on modern processors: https://stackoverflow.com/a/59495197/126995 Of all C++ compilers, only clang generates simil
790.
▲
by
Const-me
4y ago
> Vector API, which is useful in cases the JIT cannot automatically vectorise loops For vertical-only operations (vectorizable loops), people often using GPUs instead of SIMD in CPUs. Graphics cards have way more resources, both GFlops a
791.
▲
by
Const-me
4y ago
> don't benchmark well in languages with heap fragmentation issues. Microsoft has solved most of these issues on Windows, couple decades ago. The feature was introduced in WinXP, and enabled by default in Vista and all newer version
792.
▲
by
Const-me
4y ago
I usually keeping these things as indexed meshes: std::vector<Vector3> for positions, and std::vector<std::array<uint32_t,3>> for the triangles. As a nice side effect, the representation is compatible with GPUs, matches VR
793.
▲
by
Const-me
4y ago
About the search benchmark, caches alone do not explain 2 orders of magnitude difference. It's also the prefetcher. CPU cores have a special functional block which observes addresses of cache lines requested from memory, detects sequen
794.
▲
by
Const-me
4y ago
Not quite a book, but if you already know, at least to some extent, some 3D GPU API, I can recommend this series of blog posts: https://fgiesen.wordpress.com/2011/07/09/a-trip-through-the-...
795.
▲
by
Const-me
4y ago
Modern GPUs don’t know Phong shading, they expect developers to supply a pixel shader for that. However, they still interpolating all these numbers in hardware. For traditional rendering, a vertex shader outputs float4 position and a bunch
796.
▲
by
Const-me
4y ago
I wrote that article some time ago: http://const.me/articles/simd/simd.pdf
797.
▲
by
Const-me
4y ago
I guess I was lucky with the CAM/CAE software I’m working on. We don’t have too many GB of data, the stuff fits in VRAM of inexpensive consumer cards. One typical problem is multiplying dense vector by a sparse matrix. Unlike multiplic
798.
▲
by
Const-me
4y ago
My desktop PC has Ryzen 7 5700G, on paper it can do 486 GFlops FP64 (8 cores at 3.8 GHz base frequency, two 4-wide FMAs every cycle). However, that would require 2TB/sec memory bandwidth, while the actual figure is 51 GB/second of
799.
▲
by
Const-me
4y ago
> The former are useless for DP computations Looking at “double-precision GFlops” columns there [1] they don’t seem terribly bad, more than twice as fast compared to similar nVidia chips [2] While specialized extremely expensive GPUs fro
800.
▲
by
Const-me
4y ago
I don’t do web development, but when I need something similar on Linux, I usually creating custom packages. A bad thing about them, they are distro-specific: Debian is using deb packages, Alpine is using apk packages. Not just the installer
801.
▲
by
Const-me
4y ago
I’m a software engineer. Due to the tools becoming better, I already had to unlearn a few skills. For instance, 20 years ago we had to write things like ( x >> 4 ) instead of ( x / 16 ), or use tricky fixed-point math instead of
802.
▲
by
Const-me
4y ago
That works fine for simple 3D scenes. One application, that’s how MS remote desktop worked until recently — Windows streamed Direct3D rendering calls to the client. However, I’m not sure this gonna work with modern triple-A games. The curre
803.
▲
by
Const-me
4y ago
The article is about hiding latency between other people’s input, and your display. While it happens, your own input only has couple frames of latency. The solution you proposed introduces latency between your own input, and your own displa
804.
▲
by
Const-me
4y ago
I agree. And these resources are not even limited to execution units inside cores. Another one is bandwidth. On computers with dual-channel DDR4, aligned SSE vectors are delivered from main memory with a single transaction. For ideal scalin
805.
▲
by
Const-me
4y ago
GPUs are weird. HLSL and CUDA have C-like syntax, but underneath the syntax these things are very different from C. On GPU almost nothing has an address, there's no stack, no malloc/free, no files or printf, and every instruction
806.
▲
by
Const-me
4y ago
Upgrading from scalar to SSE vector, I often see an improvement by a large factor like 3-4. Sometimes, for smaller integer lanes or bytes, much more. When upgrading vectors from SSE to AVX, the speedup is very rarely by a factor of 2. More
807.
▲
by
Const-me
4y ago
Micro-ops aren't RISC instructions, too complex. For instance, vfmadd132ps instruction loads 32 bytes from memory, multiplies by 8 FP32 numbers, adds to another 8 numbers - yet on most processors that instruction decodes into a single
808.
▲
by
Const-me
4y ago
Mutex is a synchronization primitive implementing mutual exclusion. When created with a name, they can be used to synchronize processes across the whole OS. For instance, a named mutex is a good way to ensure the program can only be running
809.
▲
by
Const-me
4y ago
Interesting, but unsurprising. Russian army is attacking a part of Europe as we speak.
810.
▲
by
Const-me
4y ago
I typically choose the largest NIST curve supported in the libraries I'm using, like P521.
More ›