Are there performance worries about passing around two pointers for anything that needs to allocate, as well as storing these pointers in a struct? AFAICT this basically means two registers are eaten, and a lot of types have effectively 16 bytes of overhead. It seems like this could quickly change the calculus on what fits within cache lines and what doesn't, which people often care about for very high performance code.
I wonder if it's possible to change the compiler to detect that, if what is being used in arguments is the global default allocator, the first argument can be stripped and all references inside the function can be replaced with the global pointer. Potentially the same concept could apply to allocators that use thread local storage. (perhaps these optimizations already exist?)
This is a worry, but it's not as bad as you might initially think. The first thing to notice is that even though the "interface pointer" got fatter, the implementation got much leaner, as it no longer contains the vtable. Vtables are now shared between instances of the same type, so total memory use has gone down, and implementations can be packed more densely. If you're worried about overall cache usage, this is a net positive. The first load, from the fat pointer, is very likely to be in cache. The second load, from the vtable, will be in cache if you have used the same type recently. Which is likely if you have thousands of objects, you probably do not have thousands of implementations.
There is some additional latency because the virtual function load is now two pointer dereferences instead of one. However, C++ and Go both use double-dereference models like this, and it seems to be working fine for them. Additionally, if virtual calls like this are on your critical fast path, you have bigger problems :P
I believe that "devirtualization"--the optimization mentioned in the OP--will do exactly what you're describing, by rewriting the virtual function call as a static call to the allocator when the vtable can be determined from the callsite at compile-time.
I spent quite some time writing github.com/twmb/franz-go due to wanting more from both Sarama and from Segment’s library. Pure Go as well.
I’d recommend evaluating it as an alternative, even to confluent-kafka-go due to comprehensive feature support and (afaict) even higher performance than the aforementioned libraries.
Oh hey that looks really interesting. I'll certainly give it a look!
Lesson learned from the Sarama -> librdkafka migration: We actually wrapped Sarama in a home-grown abstraction (to handle some Zendesk-specific concerns). When we made v2 of this wrapper to support confluent-kafka-go, we made sure that no confluent-kafka-go implementation details/types leaked out of the interface. So, in theory, we can change underlying libraries again "easily" (well, with less rework in the apps at least).
I’ve tried to make the kgo package easier to use, but I think some libraries suffer from over abstracting the underlying protocol, which ultimately locks them out of some higher efficiency code or some correctness. So, I’ve tried to make the library simple yet not hide all of the details. It’s seemed to have panned out successfully for at least some people. Happy to answer any questions about it, and thanks for taking a look!
It isn't yet integrated with the schema registry, but I think doing so would be a fairly straightforward task. My primary goal before this "Show HN" was 2.6.0 feature completeness.
I'll look into integrating with the schema registry within the next month. Thanks for the reminder!
edit: there's a few other minor kafkacat features that I'd like to implement as well, such as start and end times for consuming, and producing entire files. I think those two, in addition to avro schema registry, are the main features this is missing, but otherwise kcl is much more featureful.
Long term, I think it'd be great to add support for secrets in vault, but I'd like a bit more usage before considering integrating that.
The opinion article you linked is from a right-rated source [0]. The main suggestion in it,
> That would start with the federal government imposing a national, revenue neutral carbon tax of about $200 per tonne of emissions, immediately (not $50 in 2022 under Trudeau’s plan) and then returning all the money raised back to Canadians in dividend cheques.
has pretty wide support on the left. I'm not sure how that differs from being wealth redistribution, which is what the opinion piece is against. It also doesn't describe what the current scheme is nor how it is wealth redistribution.
As far as party support for nuclear, [1]. Democrats care more about wind/solar. Neither party has majority support for emphasizing nuclear. I don't think people that care about CO2 would rule nuclear out if it were the only option.
Jets vs. thermostat type problems are tragedy of the commons. I don't appreciate private jets ferrying around political leaders, but I doubt they'll be flying commercial. That doesn't seem practical from a security nor time perspective. But, millions of people adjust their thermostats. If everybody tolerated just a liiiiittle bit less than their ideal temperature, how much would that save? Consumption is a tragedy of the commons problem.
I'd like evidence that limousine liberals are the problems w.r.t. taxes. I agree that there is hypocrisy. I disagree about how it rings hollow compared to redistributing the means, especially since "redistributing the means" doesn't even really make sense in that block of text.
Lastly, studies aren't full of blatant inaccuracies nor FUD. The world isn't ending outright, but it's getting a lot worse in a lot of ways in a lot of areas. The Syrian civil war was partially exacerbated by the worst drought ever recorded [2]. The science is settled. Exxon Mobile predicted [3] exactly what would be happening today [4] back in 1982. The conclusion of their summary is that serious adverse problems are not likely to occur until the late century, and that the time should allow for coming up with solutions. That time is now, and globally, we are doing very little, because doing what needs to be done would be economically detrimental to established interests.
As a recent Brave convert, I was skeptical of Brave for the same reason.
I switched to it from Firefox (after switching months ago from Chrome) due to Firefox being slow, tabs repeatedly crashing, UX disharmony, and the recent cert addon debacle.
Brave's ad proposition makes sense: the internet is inundated with ads, which is unpleasant, but free websites do need to survive. So, make the ad landscape nicer on an opt in basis.
This is a decent reminder blog post about something that is obvious on the surface, but subtle when you forget to think about it and make a mistake.
I've found that thinking of a lock as something you don't want to hold goes a long way. The point of locks is to release them.
Jeff Preshing has a good series on locks and concurrency. This[0] post (potentially with an extra dozen I read in the same sitting) is the one that really changed how I thought about locks: before I read it, I was very into lock freedom at every opportunity.
I caution against latching onto the title and making assumptions. The bulk of the content is analyzing where the current censorship position came from and the conclusion is for Google to be more open with their stance and also be more equal with applying it.
As for the why:
Why the shift toward censorship?
- User Demands
- before, In the absence of rules, bad behaviour thrived
- now, Appease users, maintain platform loyalty
- Government Demands
- before, Governments were unhappy to cede power to corporations
- now, Respond to regulatory demands, maintain global expansion
- Commercial Demands
- before, It’s impossible to neutrally promote content and info
- now, Monetize content through its organisation, increase revenues
- before, Advertisers were wary of unintended placement and endorsement
- now, Protect advertisers from controversial content, increase revenues
As for the conclusions:
Don’t take sides
Police tone instead of content
Enforce standards and policies clearly
Justify global positions
Explain the technology
Improve communications
Take problems seriously
Positive guidelines
Better signposts
Most of the document is non-controversial. There are places where it can be seen as obviously left leaning, but there are also places where it acknowledges that sometimes the right has been treated worse:
“[Richard] Spencer doesn't get to be a verified speaker; Milo gets kicked off, but I know
plenty of pretty abusive feminist users or left wing users,
expressing themselves in exactly the same way
that the right is being penalised for,
who are permitted
to perform certain kinds of speech. That’s going to get Twitter into
I don't know where you got "left leaning" from unless you're bending over backwards to be fair, they are if anything centrists which makes sense since they're Google. For heaven's sake, the slide about conversations of free speech, I see establishment centrist media pieces on the same plot as Breitbart and WorldNetDaily. An equivalent would be listing the Young Turks or alternet.
On the two pages titled "But recent global events have undermined this utopian narrative" there are a total of 8 events depicted. The viewer is expected to think that the events are problems. About 4 or 5 of the events would be considered good by many on the right, but bad by the left. The remaining events are just gross, weird, and otherwise unrelated to the US political spectrum.
Yeah, honestly I don't think Breitbart and similar can really play this as negative for Google when it acknowledges many actions have been taken even against right wingers unfairly and encourages "Don't take sides" as a top point.
The biggest thing to complain about would probably be the title... they couldn't have picked a worse title.
The negative for Google isn't what the briefing suggests, it is that it documents bias, it notes the impossible tension between the US and European values, and says that Google has been leaning away from US values. I think that's what Breitbart would be primarily reacting to.
There's a larger question that Breitbart is raising: should we tolerate Google - or any company - as a monopolist with censorship power over information distribution. In this case, they're an extraordinarily powerful, expansive monopolist at that. Who decides the degree to which they censor, who gets censored, what information gets censored, etc. Google isn't just a company policing its own platform. Imagine Microsoft aggressively censoring what people could browse, upload to the Internet or write on its operating system in ~2001 (or any time during peak Windows monopoly): it'd be an obvious monopoly abuse, harm to consumers, and as an extension of that monopoly position a form of censorship. Google, through the leverage of its multiple monopolies (search, YouTube, Android), is pushing toward that sort of behavior.
I was going to say that they're not really doing it on Android, but then I remembered that both Apple and Google banned the free speech absolutist social network Gab's official app.
At least on Android you can still install it without Google's consent if you so choose. Overall though what you're saying still has more validity to it than I'd like to admit.
This account looks to have been created for the sole purpose of posting this comment.
I've noticed an increasing trend of top level comments on social commentary articles immediately jumping to "liberals are the problem". Just yesterday, [0], the first reply. I do not see this happening in reverse. It is divisive and disheartening.
Further, this comment does not echo my take on the article as a whole. It's half a book review, half a person's commentary on their life in SV. The key paragraph:
> I felt like I’d ceased to become anything else,” she said. “All I did was work all the time and talk about tech.” She concluded that a job that asked her to jump from crisis to crisis, that did not admit time or perspective to consider many ideas that were outside its small world, was not the best use of her time.
The main gist of the sameness mentioned is that everything is tech.
Where is this political play coming from? Why is it a liberal problem?
On HN, I mostly see it in replies. Then again, I don't click on all comment sections; maybe I naturally have been avoiding the articles that elicit those comments.
Generally, I expect comment sections that immediately devolve into political discussions to be flagged.
Yes. Jones and Trump both subscribe to the philosophy of "there's no such thing as bad publicity...all publicity is good publicity." Jones was overjoyed when Clinton referenced him publicly in her campaign.
I wonder if it's possible to change the compiler to detect that, if what is being used in arguments is the global default allocator, the first argument can be stripped and all references inside the function can be replaced with the global pointer. Potentially the same concept could apply to allocators that use thread local storage. (perhaps these optimizations already exist?)