Better HN
topnewbestaskshowjobs
Log inSign up

tidwall

883 karma · joined Feb 3, 2015 (11y ago) · 195 submissions

Submissions

comment 7mo ago · link · parent

Looks to me like having the ability to write Go syntax and interop directly with C is the plus.

comment 7mo ago · link · parent

"To keep things simple, there are no channels, goroutines, closures, or generics."

I wonder if it could be integrated with https://github.com/tidwall/neco, which has Go-like coroutines, channels, and synchronization methods.

comment 8mo ago · link · parent

I do this all the time. I’ll spend weeks or months on a project, with thousands of wip commits and various fragmented branches. When ready, I’ll squash it all into a single initial commit for public consumption.

comment 10mo ago · link · parent

This reminds me of a card swiping video game system I made years ago.

https://youtu.be/Z2xq3ns5Hsk

https://github.com/tidwall/RetroSwiper

comment 10mo ago · link · parent

Or this.

    func fetchUser(id int) (user User, err error) {
        resp, err := http.Get(fmt.Sprintf("https://api.example.com/users/%d", id))
        if err != nil {
            return user, err
        }
        defer resp.Body.Close()
        return user, json.NewDecoder(resp.Body).Decode(&user)
    }

comment 1y ago · link · parent

A bird in the hand.

comment 1y ago · link · parent

Thanks! The Pogocache sharded hashmap design is optimized for extremely low contention and good memory locality. It super rare for any two threads to ever wait on the same key. That's the biggest part and it's all in the src/pogocache.c file. But the network layer is finely tuned too.

Mostly I perfed and profiled ad nauseam, monitoring cpu cycles along the way. I found that keeping a focus on latency and cycles was primo, and the rest fell into place.

comment 1y ago · link · parent

Thanks!

comment 1y ago · link · parent

Like an ACL file?

comment 1y ago · link · parent

Thanks you for the blog post about TG when it came out.

comment 1y ago · link · parent

Glad to bring another one into this world.

comment 1y ago · link · parent

The protocols are autodetected. No need to carry multiple ports around.

comment 1y ago · link · parent

Oh wow. That is dope. Thanks for sharing.

comment 1y ago · link · parent

Thanks Steve. Your feedback was very helpful.

comment 1y ago · link · parent

No

comment 1y ago · link · parent

Yes, it is highly hand optimized. There's a description of some of the methods I used near the bottom of there README. I mainly focused on minimizing contention, with the sharded hashmap and such. But the networking layer is carefully crafted.

comment 1y ago · link · parent

Not intending to make pogocache into a sql database. I prefer keeping it a cache. More so exploring ways to work with existing databases such as sqlite, duckdb, postgres. Kinda like providing proxy-ish operations that transparently cache sql reads.

comment 1y ago · link · parent

That's the only way right now. The other ways I'm considering is with an environment variable and/or acl.

19.

Show HN: Pogocache – Fast caching software(github.com ↗)

93 points · by tidwall · 1y ago · 29 comments

comment 1y ago · link · parent

I updated the graphs to use linear scaling. Thanks for the feedback

comment 1y ago · link · parent

Memcache binary protocol was deprecated years ago. It’s no longer recommended to be used.

comment 1y ago · link · parent

Thanks for the feedback. The plateauing is due to a taskset misconfiguration. I fixed it and reran the benches. They look much better now.

comment 1y ago · link · parent

Thanks for the feedback. I updated the graphs to use linear scale by default. Log scale is still available, which is useful for latency viewing. Also only included the summarized graphs on the README. All graphs are moved into a separate file.

comment 1y ago · link · parent

Context is not required in Go and I personally encourage you to avoid it. There is no shame in blazing a different path.

comment 1y ago · link · parent

I've stopped using autotools for new projects. Just a Makefile, and the -j flag for concurrency.

comment 1y ago · link · parent

Here's a b-tree library I wrote that uses a similar approach. https://github.com/tidwall/bgen

comment 1y ago · link · parent

Vanguard, Adventure, Track and Fields (with controller), Pitfall, Berzerk, Kung Fu Master

comment 1y ago · link · parent

Lately, I’ve found using hilbert curves with a "spatial btree" [1] beats an rtree for most of my geolocation needs.

1. https://github.com/tidwall/bgen/blob/main/docs/SPATIAL_BTREE...

29.

Show HN: Bgen – B-tree generator for C(github.com ↗)

5 points · by tidwall · 2y ago · 1 comment

1234567