« first day (1797 days earlier)      last day (1693 days later) » 

10:46 AM
If you ever wondered how memory ordering (memory barriers) actually work and which one to use (based on the specific hardware, your specific scenario, etc.) and whether it makes sense to go lock-free, then this is a fairly good talk on that matter (not perfect, but reasonably good -- I couldn't find any better so far). On a side note -- I think I mentioned this before but here it is again -- I wish Rust would have these kind of talks:
 
Rust isn't popular/vibrant enough in the embedded space yet
it's getting there, give it a year and it'll be there
 
(My link starts at the relevant bit for TL;DR'ers but I suggest watch the entire thing)
 
and that's when all these talks will come
 
But it doesn't have to be embedded to talk about these problems to be honest
If one is writing a CLI tool or a desktop app, where both of which could benefit from multithreading
then this problem will eventually come up
 
Correct, although the penalty from not going lock-free in those environments aren't as impactful
 
10:51 AM
well, in reality (depending on the given problem and hardware) that could mean 50% slower execution
 
consider the performance loss of using a mutex vs. going lock-free when you could (i.e. not going CAS and actively locking -> getting -> updating -> freeing lock). On a 40MHz processor that's a hugely noticeable loss
 
(which may or may not matters)
 
on a 4c8t processor with 2.4-2.5GHz on each core? You don't even feel it
That doesn't mean it doesn't exist, BTW, it just means that the impact is a lot less noticeable unless it's on a critical path
that's why I'm thinking those topics will come up as people get closer to the metal on devices that don't actually have that much brawn and/or #[no_std]
 
I don't think that's the right attitude for a system level programmer, isn't it? ;) I mean, I got your point, in fact I do think you are right and I strongly believe that optimisation without meaningful measurement is harmful (i.e. optimising without actually confirming the given problem is noticeable/problematic in the first place), that being said, I also believe that the main reason one chooses a system level language is because of control over details, therefore fine tuning.
Otherwise why wouldn't you write in C#, Go, D, heck, even in TypeScript and make your life much, much easier?
 
No disagreement there, but as I'm sure you can tell from the questions on SO the majority of people coming in these days are using it to prop up a webserver of some sort
i.e. actix, warp (mostly actix) with some kind of DB behind it
I don't share my own PoV I've just said, BTW, but I do believe instrumentation is the right call before deciding on an optimization unless you are certain it is the right call
it also doesn't help that none of the low-level stuff I do is on processors that actually have support for atomics
so when I do end up using them it's an even nastier tradeoff, because I know they're all emulated
I'm ready to bet that I'm in the minority camp on that one, though - that most people coming to rust nowadays, just like other programming languages/envs, will start from a higher level and eventually, maybe, work down the stack. They won't come to rust because it's a system-level language, they'll come to rust for the strict memory guarantees and performance
 
11:03 AM
Right, I think we are on the exact same page here -- marvelous!
@SébastienRenauld that's a different topic, but that's also an interesting one whether it makes sense to switch to a language on those occasions where the performance gain may not outweigh the mental barrier gain
after all, such high level applications which are done by 90% of server side code these days
the bottleneck won't ever be the business logic
(as in, a simple Python application would suffice)
 
That isn't entirely true
the bottleneck 99% of the time is the wrong abstraction, wrong data storage layout or wrong choice of indices
;-)
I've been holding off applying to a full remote position due to such fears as well
company markets "mongodb" as a startup
you know shit will hit the fan the moment they start scaling unless they've really, really chosen their data structure properly
 
@SébastienRenauld but that's not business logic, that's model/data
that's what I was referring to
my personal experience is, that's where the bottleneck is these days
(and I'm not talking about SaaS like CloudFlare, I'm talking about the 90% cases of startups and the problems they try to solve)
 
It's that or I/O 99% of the time
except in cases where you do something really dumb
at which point it ends up being in your actual code
 
@SébastienRenauld and that as well, I stand corrected ;)
 
I once worked for a company that was storing tags for objects in a VARCHAR in MySQL
space-separated
and then they'd query for a tag going WHERE tags LIKE "% tagName %"
turns out when you do that on 200M objects you end up with a query taking half an hour
so instead of that, they'd stream the entire 200M rows to PHP, and do the filtering there
turns out that takes 20 minutes, 19min59s of which spent in a single if
Time saved, sure, but time wasted when they could've done it using an associative table and done the entire query in 0.5s
 
11:12 AM
I literally had to laugh -- even if what you described is actually a crying matter
 
I built a service on top for a different project/part of the project that used this
175M keys
~1.5B associated documents
the associative table was huge, but because InnoDB B-TREE indices are amazingly performant at this kind of workload the queries were blazing
I've also seen the opposite, people using a data provider that actively encouraged doing split views by writing in multiple tables (cassandra) and not doing so
like, if your primary key in cassandra is defined as (A, B) and your query searches for (A, C) you're going to hit every shard
vs. hitting a single shard if you had two copies
 
11:39 AM
The syracuse question is a major case of reinventing the wheel at every level
 

« first day (1797 days earlier)      last day (1693 days later) »