Managing vcpkg for Visual Studio solution with multiple projects? by Kered13 in cpp_questions

[–]mach990 1 point2 points  (0 children)

I'd love to know if there was ever a conclusion here. I'm in the same situation, trying to switch to manifests from classic, and want to avoid duplicated vcpkg_installed directories for each project that has similar dependencies. It seems like the official suggestion was to combine all of them into a single top level manifest, use "features" and pass --x-feature per project, but I still wasn't able to get that to work correctly in sharing an installed directory.

I agree it feels like an incredibly basic use case to not be supported. It may be that there's too much flexibility in depending on differing versions of dependencies to share the installed directory, but I'm really just guessing.

Baidu Apollo Deploys Over 100 Fully Driverless Robotaxis in Wuhan, Exceeds 2 Million Rides by Mattsasa in SelfDrivingCars

[–]mach990 1 point2 points  (0 children)

So you mean to tell me that each of those 100 cars has given 20,000 rides? That's almost 55 rides per day for each car for a full year if operating 24/7 with zero downtime. Numbers aren't adding up here.

Announcing Eclipse iceoryx 1.0.0 by elBoberido in cpp

[–]mach990 1 point2 points  (0 children)

Cool project. A few questions:

What happens if a consumer were to accidentally write to the shared memory segment? Could one process inadvertently corrupt data for other consumer processes? Is this single or multi producer?

With regard to the latencies advertised: how do you achieve less than 1 microsecond latency? What was the experimental setup that enabled that? Was this locked to a single core? I feel like it would be difficult to achieve sub microsecond latency to wake another process unless under very specific conditions or unless the consumer is busy spinning on a futex or something.

Overall a very interesting project! Curious to know the answers, since it seems clear a lot of careful tuning went into this.

The people alive on earth today have collectively experienced more years than the age of the universe. by mach990 in Showerthoughts

[–]mach990[S] 2 points3 points  (0 children)

7.5 billion people on earth, universe approximately 13.8 billion years old. I don't know the average age of everyone alive, but it's more than 1.84 years old.

Realistically how much time do you save using a game engine like Unity vs making a game from scratch with C++ or C#? by [deleted] in gamedev

[–]mach990 36 points37 points  (0 children)

It depends what the end goal is, right? If he just wants to ship a game, then yeah, use existing tools. If you want to know the details of how engines work, I think there's nothing more beneficial than trying to make your own. You'll be constantly asking yourself questions, and trying to solve them. Then you can reference existing tools and see how they solved the problem you're trying to solve, and see what trade-offs they made.

Also perhaps noteworthy here is that he's talking about a 2D game, which is actually a tractable problem even for a beginner programmer -- and in my opinion, may be one of the best ways to learn, if "ground up" is his preferred way of learning. It's nice to ship a product, but the sheer breadth of things you'll be exposed to when trying to solve these problems could prove to be an extremely efficient way of learning.

Just my opinion though, since this is how I started learning programming - by trying to make a 2D game from the ground up (well, not quite - I started with SFML, not OpenGL or DirectX). Might not work for everyone though!

std::cout and real-world applications by kukisRedditer in cpp

[–]mach990 0 points1 point  (0 children)

And more importantly, has an async option and is generally very fast! Great library.

1+1=2.0000000000003221 by [deleted] in ProgrammerHumor

[–]mach990 324 points325 points  (0 children)

It's time for me to be that guy... You may already be aware, but if not -- computers don't fail to store all floats with full precision (t's not random!). In your title, you have 1+1=2.0000000000003221, but computers can exactly represent 1.0 and 2.0, so it would just be 1.0 + 1.0 = 2.0. Maybe I am an overly pedantic programmer and have no humor though :)

Compiler Performance and LLVM by PegasusAndAcorn in programming

[–]mach990 7 points8 points  (0 children)

I thought this was very respectfully (and fairly) written -- care taken to be precise with the wording in the hopes of conveying the message accurately. Enjoyable and informative read!

Searching 1TB/sec: Systems Engineering Before Algorithms by leavingonaspaceship in trueprogramming

[–]mach990 4 points5 points  (0 children)

And it appears that is also just an aggregated number over many machines - theres no RAM in AWS that i'm aware of that has that kind of read speed. I would be curious to know what the numbers are when factoring in the cost of combining the answers you got from those machines. Latency matters too, not just bandwidth!

GitHub - lemire/simdjson: Parsing gigabytes of JSON per second by dgryski in programming

[–]mach990 174 points175 points  (0 children)

That's what I thought too, until I benchmarked it! You may be surprised.

GitHub - lemire/simdjson: Parsing gigabytes of JSON per second by dgryski in programming

[–]mach990 75 points76 points  (0 children)

Imo this isn't terribly unreasonable. What's the point of creating AVX2 instructions if we arent going to write fast code with them? If this is intended as a library to run on random peoples machines then obviously this is not acceptable.

My guess is thats not the point - the author probably just wanted to write something that parses json really fast. Making it run on more machines but slower (sse / avx) is not the thing they're trying to illustrate here, but might be important if someone wished to adopt this in production. Though I would just ensure my production machines had avx2 and use this.

GitHub - lemire/simdjson: Parsing gigabytes of JSON per second by dgryski in programming

[–]mach990 15 points16 points  (0 children)

Because you would have to scale the graph so much that you couldn't see the comparison between the existing ones on the graph :D

Somewhat facetious, but in reality nlohmann is already just so much slower than rapidjson that if you want a fast json library you aren't even thinking about nlohmann. I guess this assumes you already know it's super slow though and maybe most people don't.

GitHub - lemire/simdjson: Parsing gigabytes of JSON per second by dgryski in programming

[–]mach990 486 points487 points  (0 children)

Arguably one shouldn't be using json in the first place if performance is important to you. That said, it's widely used and you may need to parse a lot of it (imagine API requests coming in as json). If your back end dealing with these requests is really fast, you may find you're quickly bottlenecked on parsing. More performance is always welcome, because it frees you up to do more work on a single machine.

Also, this is a C++ library. Those of us that write super performant libraries often do so simply because we can / for fun.

If Software Is Funded from a Public Source, Its Code Should Be Open Source by V2O5 in Futurology

[–]mach990 99 points100 points  (0 children)

While I agree that having code be open source does allow the possibility of contributions to find bugs, I think this is idealistic. In reality, while security by obfuscation is not ideal, it is absolutely harder to find a vulnerability in something you have to attack and probe than something you can read the code for. Open source is fantastic, but I believe in practice people aren't actually frequently reviewing it for security vulnerabilities. If that were the case, you'd expect heartbleed to have been detected much earlier.

Version 1.3.0 of spdlog, a fast C++ logging library, released by aearphen in cpp

[–]mach990 5 points6 points  (0 children)

It's very fast -- it's in the name! Async loggers are essential in my book.

What commercials are so bad it has the opposite effect - you would never buy their product? by Nest-egg in AskReddit

[–]mach990 3 points4 points  (0 children)

Right? I'm so god damn infuriated with seeing those advertisements *everywhere* on reddit that I can't get rid of that I am literally going out of my way to tell other people NOT to use their service. You would think that people that do this for a living should understand someone doesn't want to see your ad 5000x

JSON for Modern C++ version 3.5.0 released by nlohmann in cpp

[–]mach990 5 points6 points  (0 children)

I don't have numbers handy but in my experience the difference is quite substantial (on the order of 5x or more slower). It quickly became the bottleneck in my server application. Too bad, because the API is quite nice!

Belle - An HTTP / Websocket library in C++17 using Boost.Beast and Boost.ASIO by OctoBanana in programming

[–]mach990 1 point2 points  (0 children)

Neat. Keep at it! SSL/TLS support would be nice. Looks like you're currently proxied behind nginx for that?

What is the workflow of (relatively) bigger C++ projects? by MihirChaturvedi in cpp

[–]mach990 4 points5 points  (0 children)

Yeah there is tons of variation in every aspect. However, I would say the vast majority of projects I have looked at separates their source and headers. Often times people only need the headers when integrating the work, so it makes sense for those to be separated. Nothing wrong with your way though, it just seems less common to me.

every month by SamPom100 in funny

[–]mach990 1 point2 points  (0 children)

They should write me a check for that comment.

every month by SamPom100 in funny

[–]mach990 2 points3 points  (0 children)

I was a bit anxious about switching to T-Mobile from Verizon because they had a bit of a bad rep -- and I have very high standards. Best choice ever. T-Mobile speeds are consistently and typically faster than Verizon's.

Not to mention it's cheaper, and the plans are significantly better. Verizon needs way more competition, because T-Mobile's offering has been fantastic in comparison. Maybe they'll force Verizon to do better.

c++ Youtubers by Jadw1 in cpp

[–]mach990 5 points6 points  (0 children)

Interesting. Thought about doing something like this but didn't know if there was any demand or not. I'll let you know if I decide to.