Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
cmovq
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
9 ms
·
91.
▲
by
cmovq
3y ago
A TB of memory is not
92.
▲
by
cmovq
3y ago
Thanks for sharing. I don't know if the C++ standard mandates one behavior or another, it really depends on how you want clamp to behave if the value is NaN. std::clamp returns NaN, while the reverse order returns the min value.
93.
▲
by
cmovq
3y ago
Depending on the order of the arguments to min max you'll get an extra move instruction [1]: std::min(max, std::max(min, v)); maxsd xmm0, xmm1 minsd xmm0, xmm2 std::min(std::max(v, min), max); maxsd
94.
▲
by
cmovq
3y ago
The original C++ proposal [1] discusses some alternative syntaxes, including underscores. Underscores would conflict with C++ user defined literals, for example in 0xAA_BB it is unclear whether _BB is a literal suffix for 0xAA since it’s a
95.
▲
by
cmovq
3y ago
On Windows with the default cdecl calling convention structs bigger than 8 bytes don’t get passed in registers [1]. [1]: https://learn.microsoft.com/en-us/cpp/build/x64-calling-conv...
96.
▲
by
cmovq
3y ago
It’s Portuguese. It’s the same in the Lua codebase [1]. [1]: https://github.com/lua/lua
97.
▲
by
cmovq
3y ago
GCC will not warn with implicit void pointer conversions, I believe that’s explicitly allowed. It’s only when you have incompatible types like ‘float *y = (int *)x;’
98.
▲
by
cmovq
3y ago
Good SIMD code requires careful consideration of how your data is laid out in memory. This makes auto vectorization really difficult since the compiler can’t fix your data for you outside of very local contexts
99.
▲
by
cmovq
3y ago
I think a better comparison is to look at floating point performance. For example, the 10 core M2 GPU does 3.6 TFLOPS (FP32) while an RTX 4060 does 15 TFLOPS and an RTX 4090 82.58
100.
▲
by
cmovq
3y ago
> Why should they limit the highest possible graphics settings only to existing technology? This assumes Cities Skylines 2 is using some next gen graphics technology when in practice it is a Unity game without any cutting edge graphics.
101.
▲
by
cmovq
3y ago
Except Crysis looked incredible at the time. This is just Unity 3D graphics.
102.
▲
by
cmovq
3y ago
PGO is not a silver bullet. If you've identified a problem that can be solved by a simple static hint you should do that. I agree littering your code with likely/unlikely will probably make things worse, so it's best to save
103.
▲
by
cmovq
3y ago
A common use case for these is to prevent the compiler from inlining the unlikely case to avoid thrashing the instruction cache. if (unlikely_condition) { // Don’t inline this expensive_operation(); }
104.
▲
by
cmovq
3y ago
Why not: assert(someObj && someObj.data);
105.
▲
by
cmovq
3y ago
> Then you can build a single Nota document by running these shell commands: > 1. npm install --global @nota-lang/nota That's going to be a showstopper for a lot of people.
106.
▲
by
cmovq
3y ago
This really doesn’t matter. It’s only something you need to care about in your rendering backend. The rest of your engine can use whatever coordinate system you want, and you do the conversion as part of your transforms.
107.
▲
by
cmovq
3y ago
> "OpenGL is deprecated, learn Vulkan" Unfortunately this is partially true unless we get more OpenGL updates. OpenGL doesn't support hardware ray tracing and some other newer features that are only supported in Vulkan\D3D
108.
▲
by
cmovq
3y ago
Traditionally OpenCL was the alternative to CUDA. Recently AMD has been pushing their ROCm platform.
109.
▲
by
cmovq
3y ago
https://0.30000000000000004.com/
110.
▲
by
cmovq
3y ago
Interestingly both of the games you mentioned use custom engines. I think people overestimate the difficulty of rolling out your own 2D engine.
111.
▲
by
cmovq
3y ago
> libstdc++ rejects the following code (Godbolt [1]). (Microsoft accepts, but I think that might be an MSVC bug.) This is not a bug in MSVC, rather it is due to MSVC implementing std::string SSO differently than gcc or clang. Instead of
112.
▲
by
cmovq
3y ago
It’s a shame this will make graphics cards using this connector incompatible with mini ITX.
113.
▲
by
cmovq
3y ago
> 2. Prevent users from using "someprefix" as the prefix and show them the warning again. Don't do this - examples in documentation should be valid. Having an example that doesn't work when the user tries it out will
114.
▲
by
cmovq
3y ago
Rust does tradeoff performance for safety. Example: integer division [1]. [1]: https://godbolt.org/z/71sxnfff5
115.
▲
by
cmovq
3y ago
Templates are so intertwined with the C++ type system such that bringing "just templates" to C would require also bringing in a bunch of C++ features if you want templates to behave like they do in C++. Just for starters, you woul
116.
▲
by
cmovq
3y ago
(1) If the pointers you pass to memcmp are know to the compiler, then memcmp will be treated as an intrinsic, and generally the compiler generates the optimal set of instructions for a given struct. (2) Correct. The expression is only evalu
117.
▲
by
cmovq
3y ago
If you're an indie dev working during your free time, then trying to produce a game with tools you don't find interesting will just result in you making a bad game, or never finishing it. You'll learn a lot from writing thing
118.
▲
by
cmovq
3y ago
The CPU is rarely a bottleneck for AAA games, so unless the x86 emulation is particularly terrible (Rosetta isn't) it shouldn't be the issue. WINE on Linux is able to match the performance of games on Windows, so the DirectX trans
119.
▲
by
cmovq
3y ago
Despite what blogposts and HN seem to suggest, that is not how a lot of C++ code is written, for better or for worse.
120.
▲
by
cmovq
3y ago
Everyone is mentioning error codes but I think a better use is when the function returns some allocated memory, where ignoring the return value would be a bug. I’m not convinced nodiscard is very useful, however.
More ›