Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
ryao
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
26 ms
·
391.
▲
by
ryao
1y ago
Just stop using signed integers to hold sizes. malloc itself takes size_t, which is unsigned.
392.
▲
by
ryao
1y ago
I would consider the use of signed integers for sizes to be wrong, but if you insist on using them in this example, just test for (n == INT_MAX). malloc itself uses size_t, which is unsigned. I have been known to write patches converting si
393.
▲
by
ryao
1y ago
If they prove a NULL check is always false, it means you have dead code. For example: if (p == NULL) return; if (p == NULL) doSomething(); It is safe to delete the second one. Even if it is not deleted, it will never be executed.
394.
▲
by
ryao
1y ago
Division still is worse: https://github.com/ridiculousfish/libdivide
395.
▲
by
ryao
1y ago
Here is a short list: https://graphics.stanford.edu/~seander/bithacks.html It is not on the list, but #define CMP(X, Y) (((X) > (Y)) - ((X) < (Y))) is an efficient way to do generic comparisons for things that wa
396.
▲
by
ryao
1y ago
Meanwhile, GCC will happily implement bsearch() without cmov instructions and the result will be slower than a custom implementation on which it emits cmov instructions. I do not believe anyone has filed a bug report specifically about the
397.
▲
by
ryao
1y ago
That is why using heat as an input to drive the reaction is not feasible. I explained this in the sentences that followed.
398.
▲
by
ryao
1y ago
Can anyone justify why children should be required to learn about anything outside of our atmosphere beyond the sun and moon at school? It is trivia with no practical applications. It is not logical to design classification schemes for ulti
399.
▲
by
ryao
1y ago
> Wayland is the changes to X11 that are necessary in order to move forward. I have been hearing this for a decade. So far, there is room for both, especially since a number of things work better with the X11 Xorg server. This “everyone
400.
▲
by
ryao
1y ago
"Quenching isn't random" is a big change from "it doesn't happen". Quenching is random for all intents and purpose, which is why test fusion reactors have systems in place to try to detect and respond to it bef
401.
▲
by
ryao
1y ago
Fermilab would disagree with you on the quenching problem: https://lss.fnal.gov/archive/2023/slides/fermilab-slides-23-... As for the amount of radioactive material, the experimental reactors are several time
402.
▲
by
ryao
1y ago
There is a very well researched youtube video that explains a couple of these things: https://www.youtube.com/watch?v=FrUWoywZRt8 I do not recall where I heard about the helium-3 situation, but I recall hearing some figures
403.
▲
by
ryao
1y ago
> The trouble is how software has since wasted a majority of that performance improvement. It has been sacrificed in the name of developer productivity, since hardware is cheap compared to the cost of writing efficient software outside o
404.
▲
by
ryao
1y ago
It depends on the loop. Here are a bunch of loops that need bounds checks on every loop iteration: https://github.com/openzfs/zfs/commit/303678350a7253c7bee9d6... You could argue otherwise and you would not b
405.
▲
by
ryao
1y ago
They are negotiable in Rust too. Just use the unsafe keyword everywhere. If you want to use a language where they are non-negotiable, use JavaScript. Secure string functions are built into C these days. The older error prone ones are as wel
406.
▲
by
ryao
1y ago
Secure string handling functions like strlcpy() and strlcat() do have bounds checks. Not everyone uses them sadly.
407.
▲
by
ryao
1y ago
While I do not have data comparing them, I have a few remarks: 1. Scammer Payback and others are documenting on-going attacks that involve social engineering that are not getting the attention that they deserve. 2. You did not provide any a
408.
▲
by
ryao
1y ago
I have a 16 core Ryzen 9 with 128GB of RAM. I have not noticed any slowness in Signal. This might be caused by differences in our operating systems. It sounds like you run Windows. I run Gentoo Linux.
409.
▲
by
ryao
1y ago
As a regular user of vim, tmux and cscope for programming in C, may I say that not only do I prefer the old tools, but I use them regularly.
410.
▲
by
ryao
1y ago
For what it is worth, there is room for improvement in how people use scripting languages. I have seen Kodi extensions run remarkably slowly and upon looking at their source code to see why, I saw that everything was being done in a single
411.
▲
by
ryao
1y ago
You live in the UNIX world, where this insanity is far less prevalent. Here is an example of what you are missing: https://www.pcworld.com/article/2651749/office-is-too-slow-s...
412.
▲
by
ryao
1y ago
Only if they already know the concept to be able to ask about it. Otherwise, I would expect the LLM to suggest increasing the number of database connections, which punts the problem without actually fixing it. Maybe if it is being really cl
413.
▲
by
ryao
1y ago
I cannot answer this for him, but I can speculate on the answer to your first question. The transformations he described his minifier applying do not change the code from the perspective of the compiler in any meaningful way, so the end res
414.
▲
by
ryao
1y ago
Regarding bytecode delivery, have you seen SPIR-V? As for modules, avoiding them is a performance feature since it is easier to optimize code when you compile everything in one unit. Rather than go toward modules, modern graphics has moved
415.
▲
by
ryao
1y ago
> I see this is fallacy, there are a ton of industrial processes that use a ton of power just to produce heat. A great early use case for fusion will directly use the heat for these industrial processes. For example, aluminum requires ~1
416.
▲
by
ryao
1y ago
Nuclear fusion as an energy source has major unsolved problems. Off the top of my head: * The super conducting metals required for confinement randomly stop superconducting. * The fuels produce absurd amounts of radiation and the Hel
417.
▲
by
ryao
1y ago
The two being equal in efficiency is true in a best case scenario, but that ignores real world effects such as inverter losses. I wonder which would be superior in a real world test. That said, in my home, I use net metered photovoltaic pan
418.
▲
by
ryao
1y ago
The Rheem heat pump for domestic hot water that I have in my home claims a maximum energy savings of 75%. That implies that at 20% efficiency out of my solar panels, the efficiency of photovoltaic panels + the heat pump is equal to the 80%
419.
▲
by
ryao
1y ago
Comparing solar power generation to solar hot water seems wrong to me because there is solar hot water: https://www.energy.gov/energysaver/solar-water-heaters I recall hearing that they are 80% efficient while photovol
420.
▲
by
ryao
1y ago
Your use of straw man arguments in response to a straightforward historical description is both inappropriate and condescending. You may think IBM’s executives were naïve, but that does not change the actual history of the IBM PC. IBM prior
More ›