HN user

buybackoff

766 karma
Posts8
Comments181
View on HN

I had plans to buy two Airs, was not sure if I needed 13 or 15, 24 or 32, which was better for my wife and what's the best strategy to buy one for her first and then understand my needs test-driving it. Maybe I actually needed Pro. Lot's of procrastination as none of us had a real need for an upgrade. It's all in the past tense now. I've just bought a 16GB model with 1TB on Amazon at 480 EUR cheaper that the new price, and it seems cheaper than the official old price. I will forget about MacBooks until a real need comes, or maybe good ARM laptops happen sooner. It's funny that if they did not have the dichotomy between 13 and 15, I would have thought less and bought M4 as soon as it was out with the support for 2 external displays + built-in.

In the context of a proxy one should mention epoll_wait busy poll. I've recently dived into this when reviewing low-latency options, and found that it's almost possible to do user space busy polling just for simple sockets, no DPDK/VMA/io_uring needed, and Fastly contributed to this and uses it.

It's too low level, I cannot even tell that I understand everything, only the concept, so I will just share some links. It works only per NAPI epoll context, and one cannot easily control NAPI ID, but if an entire machine is dedicated for a proxy one can do a simple trick of assinging sockets by NAPI ID to dedicated pollers.

In my use case, it was not a proxy, but N socket polling on a machine that then processes received data. It does not look feasible for such case, maybe round-robin polling of NAPI contexts from a single thread may work. What I would really want to have one day from the kernel is that I can easily tell it: trust me, I will poll this single socket eventually, never ever use IRQ path for it.

Previous HN discussion of the kernel feature: https://news.ycombinator.com/item?id=43749271 Nice presentation by the Fastly contributor, with nice diagrams making the big picture much easier to understand: https://netdevconf.info/0x18/docs/netdev-0x18-paper10-talk-s... LWN articles: https://lwn.net/Articles/1008399/, https://lwn.net/Articles/997491/, https://lwn.net/Articles/959462/ Kernel docs: https://docs.kernel.org/networking/napi.html#irq-mitigation

Picollo is a new library for serious performance work in .NET. Picollo stands for Performance Instrumentation and Continuous Observation for Low-Level Optimization. The initial public release of Picollo v0.1.0 contains two components. First, a modern version of an HDR histogram, which is much faster for recording data and easier to use. Second, a set of APIs for `perf_event_open`, including fast-path reads, that give raw access to PMU counters from .NET on Linux, WSL included.

Do_not_track 3 months ago

No, it should be a required (by law) opt-in TRACK_ME_I_DO_NOT_CARE_OR_AM_A_TEAPOT=418.

The proposed way just normalizes tracking.

My Homelab Setup 5 months ago

TrueNAS works perfectly as a VM eg on Proxmox with passing through a SATA controller from the motherboard. It may not work always with bad IOMMU groups, but I have this on an old Xeon Precision Tower 3420 and not so old Asus Z690 motherboard. NVMe passthrough should be straightforward as well. No need for LSIs or cheap PCI-to-SATA cards if the number of existing physical slots is enough. And as far as TrueNAS is concerned, it's baremetal disk access. Even the latest TrueNAS is not in the same league as Proxmox for managing VMs/containers, not even close.

Floor796 7 months ago

For some time recently, I was zooming in on Bosch's The Garden of Earthly Delights. The floor's level of interactivity would be so nice there. At least on this floor, I can guess what's going on quite reliably. The experience is quite similar at some level though. I saw Bosch's originals (or 1-to-1 by size repros) many years ago and without zooming in, it was incomprehensible. With zoom, the details are overwhelming.

https://en.wikipedia.org/wiki/The_Garden_of_Earthly_Delights...

Group Policy Edit is the way to restrict many things. Disabling automatic updates helps. I have had forced reboots very rarely, I believe that were severe vulnerability fixes.

But my use case is never 24/7, I hibernate it overnight and every time I leave for longer than going to a grocery shop, and I have several Proxmox boxes with proper OSes for hosting stuff. Windows + WSL is my dev/media/web/files/OneDrive machine, a compact silent SFF box that is powerful enough for 90+% of my daily tasks. Lately I try Linux Desktop on Fedora/Ubuntu with every major version, however RDP server and secure boot that I can trust to work and not break myself - these things remain unsatisfactory.

Agreed. I had to run Windows recovery only once over the last 5+ years, after running some debloating script with many thousands stars on GitHub.

I think the Pro version is enough for reasonable experience, most of the terrible stories originate from the Home version, which should be avoided like the plague.

Then at a lower level and smaller latencies it's often interrupt moderation that must be disabled. Conceptually similar idea to the Nagle algo - coalesce overheads by waiting, but on the receiving end in hardware.

I could do half-screen nested array formulas when Excel was before the ribbon (and screen resolutions were smaller), out of necessity and because I could. It was in quite demanding uni home calculations and then mostly when working as intern in IB. But then having a life is also important...

The only thing I still enjoy is that any data smaller than 1M rows is sliced and diced almost without thinking. I am sometimes really grateful that MS did not break the shortcuts, while almost breaking the product overall. The muscle memory works perfectly.

Koralm Railway 7 months ago

Just yesterday B1M published an interesting video about the future longest tunnel between Lyon, France and Turin, Italy. It will be more than 50km, deeply below the Alps. The project has finally secured funding, from both countries and EU, and is on track.

https://www.youtube.com/watch?v=NFrr-L_BcC4

The main bike rental Velib in Paris has the app not working, but the bikes can be taken with NFC. However, my station, which is always full at this time, is now empty, with only 2 bad bikes. It maybe related. Yet, push notifications are working.

I'm going to take the metro now and thinking how long do we have until the entire transit network goes down because of a similar incident.

Unsafety means different things. In C#, SIMD is possible via `ref`s, which maintains GC safety (no GC holes), but removes bounds safety (array length check). The API is called appropriately Vector.LoadUnsafe

It looks suspicious at 25x. Even 2.5x would be suspicious unless reading very small records.

I assume both cases have the file cached in RAM already fully, with a tiny size of 100MB. But the file read based version actually copies the data into a given buffer, which involves cache misses to get data from RAM to L1 for copying. The mmap version just returns the slice and it's discarded immediately, the actual data is not touched at all. Each record is 2 cache lines and with random indices is not prefetched. For the CPU AMD Ryzen 7 9800X3D mentioned in the repo, just reading 100 bytes from RAM to L1 should take ~100 nanos.

The benchmark compares actually getting data vs getting data location. Single digit nanos is the scale of good hash tables lookups with data in CPU caches, not actual IO. For fairness, both should use/touch the data, eg copy it.

Microsoft is notoriously bad with naming. In this case likely intentionally. The SKUs: Home = Crap, Pro = OKish Windows, Enterprise = Pro. But people who do not care about lack of RDP server, Hyper-V, BitLocker do not care about the rest, probably. Then confusion araises from "first look at Windows" by pro users.

I wonder if most complaints are about pre-installed OEM Windows Home (the one with Candy Crush and 10s of other crap, including from a vendor) and bundled crappy cut-off OneDrive? I have Windows Pro and Office 365 Family option (5 accounts, full Office and 1TB OneDrive each). Most user-hidden Windows settings are in Group Policy Editor, or registry still works. OneDrive proper has toggles for every folder (Desktop, Documents, Puctures) discussed in the post.

After I lost 8 months of photos with a phone ~10 years ago, being sure it was all backed to Google Photos, I would rather trust Microsoft, than risk losing data, and now backup to both clouds. The paid Office+OneDrive is great value.

It just works. Yes, defaults are annoying, but could be changed. I recently enabled a blocked-by-default outgoing firewall, and I have much more questions to JetBrains Rider trying to ignore my system DNS setting and so to bypass Pi-Hole multiple times per minute, than to Microsoft.

I use an extension for arrays, something like:

    internal static class ArrayExtensions
    {
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static ref T RefAtUnsafe<T>(this T[] array, nint index)
        {
    #if DEBUG
            return ref array[index];
    #else
            Debug.Assert((uint)index < array.Length, "RefAtUnsafe: (uint)index < array.Length");
            return ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), (nuint)index);
    #endif
        }
    }
then your example turns into:
    public static void AddBatch(int[] a, int[] b, int count)
    {
        // Storing a reference is often more expensive that re-taking it in a loop, requires benchmarking
        for (nint i = 0; i < (uint)count; i++)
            a.RefAtUnsafe(i) += b.RefAtUnsafe(i);
    }

The JITted assembly: https://sharplab.io/#v2:EYLgxg9gTgpgtADwGwBYA0AXEBDAzgWwB8AB...

I'm convinced C# is so much better for high perf code, because yes it can do everything (including easy-to-use x-arch SIMD), but it lets one not bother about things that do not matter and use safe code. It's so pragmatic.

See also the top comments from a recent thread, I totally agree. https://news.ycombinator.com/item?id=45253012

BTW, do not use [MethodImpl(MethodImplOptions.AggressiveOptimization)], it disables TieredPGO, which is a huge thing for latest .NET versions.

For working with arrays elements without bound checks, this is the modern alternative to pointers, without object pinning for GC and "unsafe" keyword: MemoryMarshal. GetArrayDataReference<T>(T[]). This is still totally unsafe, but is "modern safer unsafe" that works with `ref`s and makes friends with System.Runtime.CompileServices.Unfafe.

Funny point: the verbosity of this method and SRCS.Unsafe ones make them look slower vs pointers at subconscious level for me, but they are as fast if not faster to juggle with knifes in C#.

The `fixed` keyword is mostly for fast transient pinning of data. Raw pointers from `fixed` remain handy in some cases, e.g. for alignment when working with AVX, but even this can be done with `ref`s, which can reference an already pinned array from Pinned Object Heap or native memory. Most APIs accept `ref`s and GC continues tracking underlying objects.

See the subtle difference here for common misuse of fixed to get array data pointer: https://sharplab.io/#v2:C4LghgzgtgPgAgJgIwFgBQcDMACR2DC2A3ut...

Spans are great, but sometimes raw `ref`s are a better fit for a task, to get the last bits of performance.

Inetersting, the paper explain how remineralisation works and the role of F and fluoroapatite. This reminds me the recent Veritasium video about why Teflon is so strong - F chemical bonds are the strongest.

For Novamin alone, I've seen and understood the claims of sensitivity protection with hydroxyl-carbonate apatite (HCA). The paper explains it in 4.3. The layer is temporary and protects from acids, conserving the teeth tissue below.

But F is essential and my paste has it together with Novamin. It seems they may work well together. But the paper also explains that F works with saliva rich in minerals to repair the enamel. So if Novamin creates a strong layer, it may block access of F + saliva to enamel (my speculation, as in 4.2 they say "A clean tooth surface is required to access the mineral-deficient spot.").

So maybe a classical Ca+F paste is better overnight when no acid exposure is expected, but Novamin is nice in the morning before breakfast.

I had an impression that Novamin creates an artificial layer as strong as natural enamel, and fills tiny holes that are responsible for high sensitivity with this material that crystallizes with water contact. Then normal Ca+F mineralisation is orthogonal. Novamin itself contains Ca, can it really migrate from the crystals into the tooth tissue?

The picture says "enamel-mimicking" and the text says "protective coating that mimics the structure and function of natural enamel", so it looks like a protective layer, not true repair. I've been using a paste with novamin lately, it also creates a protective layer and is also marketed as "repair". I like it and feel some heat when it contacts with teeth, so the chemical reaction must be working. But the marketing leaves a bad taste in the mouth.

A little offtop, but do you know a number in usecs that io_uring can save on enterprise grade servers, with 10G NICs, for socket latency overheads vs LD_PRELOAD when hardware supports that? Let's say it's Mellanox 4 or 5. My understanding is that each gives around 10us savings, maybe less. Based on some benchmarking, which was not focused on any of those explicitly but had some imprecise experiments. It also looks like they do not add up. Do you have a number based on real experience?

It does have great tail latency. But it's not a silver bullet, but careful engineering. And you pay for the latency with spinning threads. It's the architecture that makes it to stand out. In the end, it's just the same old UDP sockets, not even io_uring at least in the free public version. But one can use LD_PRELOAD if hardware has this trick - but again, it's not specific to Aeron.

I would not recommend using Aeron on long fat pipes with a chance of packet loss for hight throughput. It was several years since I stress tested this, maybe there have been improvements. I saw some work on that in release notes after. But that was the worst case as recovery was slow.

I would think of UDP with redundant encoding / FEC, to avoid retransmits.