Back to News
Advertisement
Advertisement

⚡ Community Insights

Discussion Sentiment

60% Positive

Analyzed from 238 words in the discussion.

Trending Topics

#consistent#key#post#code#nginx#hashing#algorithm#crate#garbage#rust

Discussion (9 Comments)Read Original on HackerNews

officialchicken•21 minutes ago
Come on CF, you can't even be bothered vibe a README for the crate? Somebody tear down this post until this garbage is documented properly.

I found this in the code, it looks like a rewrite-in-rust:

//! # pingora-ketama

//! A Rust port of the nginx consistent hashing algorithm.

//!

//! This crate provides a consistent hashing algorithm which is identical in

//! behavior to [nginx consistent hashing](https://www.nginx.com/resources/wiki/modules/consistent_hash...).

//!

//! Using a consistent hash strategy like this is useful when one wants to

//! minimize the amount of requests that need to be rehashed to different nodes

//! when a node is added or removed.

cyberpunk•5 minutes ago
Anyone have an idea how it behaves differently from google's jump hash algorithm? The cool thing about google's one is it's so short I can include it in a HN comment:

    int32_t JumpConsistentHash(uint64_t key, int32_t num_buckets) {
      int64_t b = 1, j = 0Íľ
      while (j < num_buckets) {
        b = jÍľ
        key = key * 2862933555777941757ULL + 1Íľ
        j = (b + 1) * (double(1LL << 31) / double((key >> 33) + 1))Íľ
      }
      return bÍľ
    }
https://arxiv.org/pdf/1406.2294
agosta•10 minutes ago
We can tell you didn't read the post because it is definitively NOT garbage. Very interesting write up by the Cloudflare team - the man literally did calculus to improve something. When's the last time any of us did Calculus to improve anything? Bang up job Kevin and everyone!!
go_elmo•about 1 hour ago
Was this vibecoded? I hope so, would expect models to be good enough by now, its not that creative.
n738•42 minutes ago
go_elmo is unimpressed everyone. Pack it up. Time to go home.
Maxion•about 1 hour ago
I think it's more important now than it was last year to differentiate pure yolo vibecoding from "AI assisted engineering" or "AI engineering", I.e. deliberate and careful use of AI to speed up coding but without creating too much slop. Maybe aineering?
wild_pointer•about 1 hour ago
Nah, AI code is black or white, and whether the code is good depends on your religion.
kawogi•about 1 hour ago
AIded development?
derwiki•about 1 hour ago
Just like the original harness, aider.chat
readthenotes1•about 1 hour ago
I expect a another post in a year where they get a performance improvement by reducing the number of calls to create integers from bytes.