Nature vs Golang: Performance Benchmarking

(nature-lang.org)

2 points | by weiwenhao 8 hours ago ago

3 comments

  • AlanLan 7 hours ago ago

    Impressive benchmarks. As a developer focused on high-performance C++ systems, I’m always on the hunt for languages that can match C++'s predictability without the manual overhead.

    I noticed Nature's performance is quite competitive with Golang. I'm curious about the 'long-tail' stability. In my current project (a high-frequency engine built with Modern C++), I've managed to achieve a state where memory footprint actually stabilizes and shrinks—from 13.6MB down to 11MB after a week of uptime on Win10, thanks to strict RAII and zero-leak idioms.

    How does Nature's runtime/GC handle memory fragmentation and predictability over extended periods (e.g., 100+ hours of uptime) compared to Go's scavenger? That's usually where the 'real' performance gap shows up in production.

    • weiwenhao 5 hours ago ago

      Nature's runtime architecture draws heavily from Go, with its GC similarly referencing Go's allocator and collector approaches. However, the use of mark-and-sweep GC inevitably leads to memory fragmentation issues. Virtual memory usage tends to advance progressively. In contrast, the span-based memory allocator avoids significant fragmentation problems during frequent memory releases and allocations.

      ---

      I also believe predictable memory management is crucial. An arena-based supplementary memory allocator could be the next key feature.

  • weiwenhao 8 hours ago ago

    I am a core developer of the nature programming language, welcome to talk to me!