New stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Steam Frame Review – PC Gamer(pcgamer.com ↗)
    discuss
  2. Show HN: Writeably cuts the waffle without losing your meaning or voice(writeably.com ↗)
    discuss
  3. iCloud backup – 5GB available, but I can't use it
    discuss
  4. Show HN: (alter)native-Linux-builder for Nix on Darwin(github.com/quinneden ↗)
    discuss
  5. Show HN: Breakdown: a daily game about guessing data distributions(breakdown.today ↗)
    discuss
  6. Gemini 3.8 Live(ai.google.dev ↗)
    discuss
  7. Software Citations from Replication Files(recite.github.io ↗)
    discuss
  8. One seeded bug, 26 AI agents: all passed the tests, all stayed broken(github.com/vyang472 ↗)
    discuss
  9. Show HN: Whop Video Downloader(chromewebstore.google.com ↗)
    discuss
  10. Show HN: Review agent changes locally before pushing(github.com/marcparadise ↗)
    discuss
  11. Show HN: In-Browser WASM Engine – Analytical Queries in 0.25ms(mlegal-pwa-app.web.app ↗)
    discuss
  12. The Story of Fckgw-RHQQ2-Yxrkt-8TG6W-2B7Q8(twitter.com/davepl1968 ↗)
    discuss
  13. Photos show damage at U.S. positions caused by Iranian missile, drone attacks(cbsnews.com ↗)
    discuss
  14. Single Prompt Knowledge Graphs(corvic.ai ↗)
    discuss
  15. Khipu (Quipu) Field Guide(khipufieldguide.com ↗)
    discuss
  16. Grandma disables a fiber optic drone(twitter.com/united24media ↗)
    1comments
  17. Trump administration releases fifth batch of UFO files(space.news ↗)
    1comments
  18. Show HN: Thurbox – A tmux-based TUI and CLI for local AI agent orchestration(github.com/thurbeen ↗)
    discuss
  19. We cut CDN metadata lookup latency by 91%(vercel.com ↗)
    discuss
  20. Artificial Intelligence, Quote Unquote(penny-arcade.com ↗)
    discuss
  21. The Death of "Link in Bio"(peachandcherry.com ↗)
    discuss
  22. Seats and Sunsets(yegge.ai ↗)
    discuss
  23. Medog Hydropower Station (60 GW hydropower project)(wikipedia.org ↗)
    discuss
  24. I Hired a Lawyer to Fight UMG (Feat. LegalEagle) [video](youtube.com ↗)
    discuss
  25. Nvidia Expands Open Source CUDA-Q Platform for Fault-Tolerant Quantum Computing(nvidia.com ↗)
    discuss
  26. A mnemonic-free wallet where the private key never leaves the phone's TEE
    discuss
  27. Marginalia Search(marginalia-search.com ↗)
    discuss
  28. Internet shutdown crosses 100 days in Pakistan-administered Kashmir(aljazeera.com ↗)
    discuss
  29. Musk proposes adversarsial peer review for AI Safety(twitter.com/theallinpod ↗)
    1comments
  30. Thoughts and Observations on apples iPhones duo 18pro event(daringfireball.net ↗)
    discuss

Ask HN: Why serialize documents to disk instead of memory-mapping runtime state?

2 pointsby 2h ago
4 comments
Opening files like docx requires heavy string parsing and pointer allocation. After an OS swaps active RAM pages out as to flash disk as virtual memory, it can restore them almost instantly. Using 2X more flash disk space is worth if we can achieve millisecond loads. Why hasn't direct memory dumping/reloading replaced file parsing for complex document models?

I started a company in 2000 to build a commercial cross-platform desktop suite in Java. To achieve seamless live-data-linking across text, sheets and slides, we stored data objects into a 3D coordinate space (Sheet_Num,Row_Num,Column_Num) and reference/access them instead of pointers. This scheme enable us open a 50,000-pages document in 8 seconds, compared to 300+ seconds by a competing suite requiring parsing andan array of pointer construction.

Recently, some suggested that our 3D design without referencing data by pointers can possibly use OS provided mmap to restore back the entire document image as loaded into the RAM to flash disk. Instead of opening the file again with all those parsing/pointer-building work, the memory mapped buffers can be simply be brought back into RAM in milliseconds.

Our senior engineers have confirmed the feasibility and tries to prove it, but, they have encountered numerous problems to save using OpenJDK and CRaC on Linux. They told me that OpenSDK has stated that it can be done but probably did not test this part thoroughly because they never expected it be actually used.

Has any one successfully decouple a complex document substrate into off-heap memory to achieve true zero-copy mmap load or does the JVM runtime always get in the way?

2h agoHN ↗

So we can share them with each other? Are we going to pass around memory dumps instead? What about tool choice when working on a specific document format?

2h agoHN ↗

Serializing has many uses.

- Memory might not look the same on all platforms, if your app is multi-platform you stop being able to share your data cross-platform.

- The internal data structures of your app will absolutely change as your app evolves, the binary data in memory is a raw result of your data structures. So you have to commit to never changing data structures, or create complicated binary migration tools to update memory when your app updates.

- Debugging corrupted memory is incredibly tedious any sometimes impossible. Having plain text serialized data makes debugging much more straightforward.

Top my my head I would suggest to focus more on improving performance on your serialization pipeline. There might be some subset of your data that is unlikely to ever change and is identical on all platforms, maybe your serializer is hybrid in that case.

1h agoHN ↗

When you use RandomAccessFile API in JVM one of the flags allows you to mmap the contents

        try (RandomAccessFile file = new RandomAccessFile("example.dat", "rw");
             FileChannel channel = file.getChannel()) {
            
            // Map the file into memory from position 0 up to bufferSize
            MappedByteBuffer buffer = channel.map(FileChannel.MapMode.READ_WRITE, 0, bufferSize);

Once you have a mappedbytebuffer you can use MemoryLayout from FFM to view it as structured data without deserializing

1h agoHN ↗

Be careful!

I hear the old Microsoft Word save files used memory dumps, which became an undocumented nightmare of a file format.

You need total control over memory layout of the saved runtime state. No hidden fields. No pointers either - you want to be able to reload at another address. Sooner or later, you might want to add some state, and you'd need a place to put it.

That said, I have used mmap something like this, mostly so state (data) could be paged in on demand.