I always wondered why the fsync has to be lazy. It seems like the fsync's can be bundled up together, and the notification messages held for a few millis while the write completes. Similar to TCP corking. There doesn't need to be one fsync per consensus.
Yes, good call! You can batch up multiple operations into a single call to fsync. You can also tune the number of milliseconds or bytes you're willing to buffer before calling `fsync` to balance latency and throughput. This is how databases like Postgres work by default--see the `commit_delay` option here: https://www.postgresql.org/docs/8.1/runtime-config-wal.html
I must note that the default for Postgres is that there is NO delay, which is a sane default.
> You can batch up multiple operations into a single call to fsync.
Ive done this in various messaging implementations for throughput, and it's actually fairly easy to do in most languages;
Basically, set up 1-N writers (depends on how you are storing data really) that takes a set of items containing the data to be written alongside a TaskCompletionSource (Promise in Java terms), when your stuff wants to write it shoots it to that local queue, the worker(s) on the queue will write out messages in batches based on whatever else (i.e. tuned for write size, number of records, etc for both throughput and guaranteeing forward progress,) and then when the write completes you either complete or fail the TCS/Promise.
If you've got the right 'glue' with your language/libraries it's not that hard; this example [0] from Akka.NET's SQL persistence layer shows how simple the actual write processor's logic can be... Yeah you have to think about queueing a little bit however I've found this basic pattern very adaptable (i.e. queueing op can just send a bunch of ready-to-go-bytes and you work off that for threshold instead, add framing if needed, etc.)
Ah, pardon me, spoke too quickly! I remembered that it fsynced by default, and offered batching, and forgot that the batch size is 0 by default. My bad!
Well the write is still tunable so you are still correct.
Just wanted to clarify that the default is still at least safe in case people perusing this for things to worry about, well, were thinking about worrying.
Love all of your work and writings, thank you for all you do!
That was my immediate thought as well, under the assumption the lazy fsync is for performance. I imagine in some situations, delaying the write until the write confirmation actually happens is okay (depending on delay), but it also occurred to me that if you delay enough, and you have a busy enough system, and your time to send the message is small enough, the number of open connections you need to keep open can be some small or large multiple of the amount you would need without delaying the confirmation message to actual write time.
In practice, there must be a delay (from batching) if you fsync every transaction before acknowledging commit. The database would be unusably slow otherwise.
Right, I think the lazy thing implies that it would happen post "commit" being returned to the client, but it doesn't need to be. The commit just needs to be wait for "an" fsync call, not its own.
Both ints and floats represent real, rational values, but every operation in no way matches math. Associative? No. Commutative? No. Partially Ordered? No. Weakly Ordered? No. Symmetric? No. Reflexive? No. Antisymmetric? No. Nothing.
The only reasonable way to compare rationals is the decimal expansion of the string.
> The only reasonable way to compare rationals is the decimal expansion of the string.
Why decimal? I don’t see why any other integer base wouldn’t work, and, on about any system, doing 2^n for any n > 0* will be both easier to implement and faster to run.
And that, more or less, is what the suggested solution does. It first compares the first 53 bits and, if that’s not conclusive, it compares 64 bits.
Also, of course, if your number has more than n bits, you’d only generate digits until you know the answer.
What exactly do you say is not commutative? This Wikipedia article claims that at least floating-point addition and multiplication are both commutative:
I've been throwing moderately large parties the past 2 years (12-40 people) and the lack of partying is definitely noticeable. Most people don't reciprocate, making it disheartening to keep doing it. I wanted to build friendships out of it, and hopefully get invited to more parties myself, but so far it hasn't happened. It's a decent amount of set up (cleaning, buying food, coordinating), and a lot of clean up after too. The ROI isn't where I want it.
I kind of wonder if people have just forgot what to do after the party is over. I had hoped it would be "that was so fun, we should host one", but instead it just kinda fades away in their minds.
To each their own.. but I think throwing a party to make friends is a totally reasonable plan and expectation. And if it isn't working out, then the ROI isn't there.
I go to "couples game nights" with my wife and her friends even though I don't really like them. But I like having friends in the neighborhood. So it's worth it to me when one of her friends husbands (who is now my friend) shows me the deck they've been building in their backyard all because I went to a somewhat painful game night.
I think you have it nearly completely backwards. Society would be far better off if more people were willing to do the "un-fun" things (like planning and hosting a party) in order to socialize. GP should be applauded.
It still seemed weird to me, and I'm trying to view it in the most generous light possible.
When I was younger there were folks who were just known as "the people who threw parties", simply because they loved throwing parties. They didn't view it as some expenditure where they expected any mutual return - the party was the return.
Now, of course there were some actual expenditures for food/drinks, and also the cleanup time. But the host would simply ask people to pitch in, and people always did.
The "ROI" comment just struck me as a mindset that views relationships transactionally. Yes, relationships are and always have been at least someone transactional (not many folks are going to continue spending time and effort on a relationship they don't feel is adding to their life), but not in this "mathmatical" tabulation of it.
Very few people want to host/organize other people.
The end goal of throwing parties shouldn’t be friendship or getting invited to other people parties, it’s building a large loose network of people you’re acquaintances/shallow friends with and becoming a super connector.
If you ONLY want to make friends or get invited to parties I think focusing on finding specific people and spending time with them 1:1 is a much better way to do that.
Many commenters focusing on the ROI part of your comment but I totally agree with your premise based on my own experience as a young person.
How I would word it is younger people are generally less inclined to invest in (real/in-person?) social interaction. I suspect some bar for motivation or entertainment has changed so people don't socialise the same. Probably intertwined with rise in mental health issues too. Be less interested in socialising and it's no surprise the result is less socialising, in one form or another.
In my experience yeah people don't often reach out or reciprocate effectively when it comes to socialising. Or they stick to a very small group.
> I wanted to build friendships out of it, and hopefully get invited to more parties myself, but so far it hasn't happened.
From this and other comments, it seems you think you didn't make friends, because you're not invited to other parties. There seems a leap here.
If the others are holding big parties and not inviting you - sure.
If they just don't throw parties, then they likely are still your friends :-)
But as another commenter said: Going to parties is not necessarily the best way to make friends. Whenever I go to a big party, the host is way too busy to spend a meaningful amount of time with me. Of course he's not going to become my friend that way! Going to big parties is for guests to make friends with other guests - not with the host.
I have some good friends who throw only big parties - I've stopped going to them. What's the point if I can't interact with them?
That's about the right size for a potluck. Set a rough guide for the main and have people post what they're bringing. If they're good friends they'll put their dishes in the washer/sink and some will help clean before they leave. If they aren't good guests (bring something + fun + clean up) they don't get invited back. Have it once a month on the same day. Plan to rotate it and talk about it at the party.
Of course people have all sorts of different ideas of what a party should be, what to bring, and what to do while you're there, but doing it all yourself is really hard. If you're getting it catered with cleaning staff, it's very different than having mostly the same close friends, month after month year after year.
If you happen to live in San Diego, I'll happily invite you to my parties! They generally involve board games, making a fire, having dinner, watching a movie, or going to the beach. Alcohol optional. Not super wild, but always a good time for me :)
Also if you just want to make your own parties easier to host, you can ask the guest list if anyone will volunteer to help with specific tasks or supplies.
That's a point that's often overlooked. I suspect many of the "amazing insights." LLM events only happen because training sets encompass an extensive range of knowledge and can arrive at conclusions previously unseen.
One could reasonably claim that the value of AI systems and very large training sets is not that it is an approach to AGI, but that it makes finding previously unseen connections possible.
There's a great graph showing the wages stagnating compared to GDP growth. It looks like wage's haven't gone up. But, when adding back in employer provided health coverage and other benefits, the graphs align again. It just wasn't in dollars. TFA briefly mentions it but I think it should be front and center.
Without digging in to details that's an interesting thought. If modern american healthcare costs were to (magically) get under control, would wages become reasonable (per other living expenses) again?
GDP is a really poor measure of activity. It can be concentrated in a single entity, and retain the same values. It also doesn't account properly for money-printing.
The point is that there's enormously different implications. If comp stagnates less than productivity then you have a huge bargaining problem.
If comp keeps pace with productivity but is all eaten up by healthcare costs, either something caused people to willingly spend much more of their money on healthcare costs than they'd do earlier (aging maybe? obesity maybe?) or something is going crazy with healthcare expenses.
I've heard persuasive evidence that if you control for obesity the costs look ok actually.
The business-owner class benefits from the health system, because the business-owners are the gatekeepers of healthcare (typically, people get healthcare only through their employer). The worker class is less likely to benefit from the free part of the "free market" because their healthcare is tied to their employer; it's just harder to do anything except work a typical 9-to-5 for the benefit of a business-owner.
The healthcare industry also benefits because they get to suck up a large portion of the GDP; trillions of dollars.
So wages aren't only flat, but the wage growth that should have happened instead went into a corrupt system. Wages aren't honestly flat because of natural market forces, they are corruptly flat.
> The business-owner class benefits from the health system,
That is a new argument, coming from health care is a right and good for society?
It’s kinda crazy you want to dismiss this simply because it benefits some group of people you don’t like.
In any se your argument is this is worse. And I argue this is good, fair and meritocratic , and sustainable.
While the USA has wealth, you can simply expand your idea beyond the walked garden of a single country and to the world stage. There is no way with today’s tech and cost of labor could we ever give free health care to everybody. World wide there are far more people who exist, than people who exist and contribute back to society.
The dream of unlimited free healthcare can only be archived once > 90% of humans are producing more than they consume, which war are no where near even in the richest of rich, the USA.
They have it because they don't spend on defense like the USA does.
The US taxpayer is the world's golden goose and by means of things like NATO are subsidizing the European socialist healthcare systems.
If the USA cut it's funding in these lines Europe would be back to square one in a very shot time.
> They have it because they don't spend on defense like the USA does.
That doesn't feel right to me.
In the most recent year with data, as a percentage of gdp:
party healthcare military
eu 10.95% 1.56%
usa 17.36% 3.45%
stark difference, but "the only reason eu has socialized healthcare is because of their low military spending" just doesn't reconcile in my mind to the above numbers
The US pays more per person for healthcare than any other nation. This would be true if we doubled defense spending, or if we cut defense spending to zero.
This just seems like the USA's poor spending choices. We could easily have a similar healthcare system as the rest of the developed world, if we chose not to buy all those bombers and aircraft carriers.
I don't know the source of this rhetoric but you should look into the data instead of spewing this garbage. Another comment already put up the percentage expenditure on healthcare between what you consider "socialist" healthcare system, and the USA's corrupt system. You pay more for a lower quality service, the socialised (not socialist) system is less onerous to societies than the middlemen-riddled system of the USA, you get more bureaucracy, less coverage, while paying through the nose for a service you don't even know you will get provided.
It's simply a stupid system, it doesn't work, in a functioning society it would be accepted as a massive issue and reworked. Instead you have your democratic system captured by corporations who need this system to be perpetuated, you are right about the US taxpayer being the golden goose but not for the world, it's the golden goose for whole industries operating inside the USA to work on extracting maximum value from its population.
It's not the rest of the world milking you, it's your own corporations milking you dry.
How am I supposed to start a small business if I’m dependent on my big corpo job for healthcare?
Without a robust social safety net, only the rich and well-connected can afford to take economic risks. Eventually, this just results in a flat-out oligarchy.
Type inspection is the flaw of Go's interface system. Try to make a type that delegates to another object, and the type inspection breaks. It's especially noticeable with the net/http types, which would be great to intercept, but then breaks things like Flusher or Hijacker.