HNHacker News
TopNewBestAskShowJobs

mandarax8

146 karma · joined September 1, 2021

submissionscomments
mandarax8··on Writing Efficient C++ Code (2013)
Because in your benchmark all std::map nodes were allocated in succession, most likely being placed in adjacent memory locations...

This likely won't be true in a real application with a non-trivial allocation pattern.

mandarax8··on Project Valhalla, Explained: How a Decade of Work Arrives in JDK 28
> I actually don't understand the tearing they're talking about. If the fields are final then you can't modify the Value Type anyway?

You can assign the object again to overwrite it 'in place'.

> And a simple write-lock bit for fat Value Types would solve everything while maintaining most of the performance benefits (both on read and write)

They even already have an extra 'null' bit tacked on to the value object.

mandarax8··on A Wayland Compositor in Minecraft
Is there any reason that you couldn't implement this on Xorg?
mandarax8··on Reverting the incremental GC in Python 3.14 and 3.15
Please read up some more about Java and GCs. Memory allocation and GC are heavily intertwined.
mandarax8··on Optimizing a lock-free ring buffer
See https://fgiesen.wordpress.com/2012/07/21/the-magic-ring-buff... which takes it even further :)
mandarax8··on A tale about fixing eBPF spinlock issues in the Linux kernel
Indeed I misread. I figured the NMI must have been nested or otherwise they wouldn't have gone through all this trouble just to drop samples :)
mandarax8··on A tale about fixing eBPF spinlock issues in the Linux kernel
Not OP: how would you handle the second interrupt during the interrupt handler here then? I can see how you could use two separate ring buffers for different contexts, but I don't see how to handle the nested interrupt. Also indeed they just drop all these samples that get deadlocked.

Actually, as long as you use different ring buffers for interrupt/non-interrupt context, it should be fine to just drop if you encounter a deadlock due to interrupting an already running interrupt handler.

mandarax8··on A tale about fixing eBPF spinlock issues in the Linux kernel
One thing wasn't clear for me in the article: is there only one such ringbuffer defined by the kernel or can the eBPF program specify as many ringbuffers as it wants?
mandarax8··on An interactive intro to quadtrees
I give up, tell me the AABB trick please
mandarax8··on C++ says “We have try... finally at home”
The entire point of the article is that you cannot throw from a destructor. Now how do you signal that closing/writing the file in the destructor failed?
mandarax8··on 4 billion if statements (2023)
Maybe we can even find some correlation in the bit pattern of the input and the Boolean table!
mandarax8··on Shaders: How to draw high fidelity graphics with just x and y coordinates
The pixel position has to be known, how else are you rasterizing something?
mandarax8··on Apple M5 chip
Their current OpenGL 4.1 actually does run on top of metal making it even more blatantly obvious that they just don't want to.
mandarax8··on OpenGL: Mesh shaders in the current year
I'm not sure exactly what you mean, but you can both output line primitives directly from the mesh shader or output mitered/capped extruded lines via triangles.

As far as other platforms, there's VK_EXT_line_rasterization which is a port of opengl line drawing functionality to vulkan.

mandarax8··on Under the hood: Vec<T>
That said MSVC,GCC and clang all implement it to allocate an exact value.
mandarax8··on Shipping WebGPU on Windows in Firefox 141
Can you point me to some good middleware then? I haven't been able to find any.
mandarax8··on Parameterized types in C using the new tag compatibility rule
Any kind of relative/offset pointers require negative pointer arithmetic. https://www.gingerbill.org/article/2020/05/17/relative-point...
mandarax8··on Bzip2 crate switches from C to 100% Rust
You can still statically link all your own code but dynamically link libc/other system dependencies.
mandarax8··on Simplest C++ Callback, from SumatraPDF
Yeah it's a shame that to go from your idea to something that's 'general' (ie just some arbitrary arguments) you need to write this arcane garbage.
mandarax8··on Simplest C++ Callback, from SumatraPDF
std::bind is bad for him for the same reasons std::function is bad though
mandarax8··on Simplest C++ Callback, from SumatraPDF
What he shows here is 75% of c++26's std::function_ref. It's mainly missing variadic arguments and doesn't support all types of function objects.

https://github.com/TartanLlama/function_ref/blob/master/incl...

mandarax8··on Fun with Futex
But you can embed this 1 byte lock into other bigger objects (eg. high bytes of a pointer).

With 4 byte locks your run into the exact same false sharing issues.

mandarax8··on Show HN: Hexi – Modern header-only network binary serialisation for C++
Because the only way to do metaprogramming in C++ is via the type system. Thismakes it so you need to implement 'functions' as types.
mandarax8··on Germany's Water Consumption Down 17% Following Nuclear Reactor Shutdowns
Guess: it's too much water to cool down in a small local reservoir.
mandarax8··on Making any integer with four 2s
I would allow it, given they physically write down all N square root on a piece of paper.
mandarax8··on The Sims Game Design Documents (1997)
'So what are the requirements for this project?'

'Requirements? Were agile, we'll figure it out as we go!'

...

Actual conversation a while back at work regarding a (now failed) project.

mandarax8··on Ketamine for Depression: How It Works (2024) [video]
You're saying this as if psychedelics cannot 'have all sorts of severe, life-altering, mostly permanent side effects'.
mandarax8··on Navtive FlameGraphViewer
I've never had hotspot not be fast enough. Even on 20Gb traces, everything is instant.

Only thing that ever takes some time is the initial load of the perf file and filtering (bit still really fast).

mandarax8··on The number pi has an evil twin
But this doesnt have the property that the product of the distances to the focal points is constant no?
mandarax8··on The number pi has an evil twin
Heres two examples for 3 and 6 points in 2D, 3D respectively: https://en.wikipedia.org/wiki/Cassini_oval#Generalizations

These are symmetric as well though.

Page 1 of 3Next →