Earlier quoted context omitted.
Is performance inversely proportional to dev experience? because what you wrote could be said about using C++ in the context of dev experience 10 compilers, IDEs, debuggers, package managers and at the end of the day LLVM compiles 30min and uses tens of GBs of RAM on average hardware I don't believe that this is the best we can get.
Huh? "10 compilers, IDEs, debuggers, package managers" what are you talking about? (Virtually) No one uses ten different tools to build one application. I don't even know of any C++-specific package managers, although I do know of language-specific package managers for... oh, right, most scripting languages. And an IDE includes a compiler and a debugger, that's what makes it an IDE instead of a text editor. "and at t…
The computers are fast, but you don't know it
181–190 of 819 posts
Re: The computers are fast, but you don't know it
#182Earlier quoted context omitted.
Nah that part I'm not worried about. The "cheating" is omitting the rest of the line. What you really needed was: var y = Enumerable.Range(1, 50).Where((x, i) => i % 4 == 0).Where(e => e % 3 == 0).Skip(1).Select(e => e + 4).ToArray(); Compare that against: y = [t[1] for t in enumerate(range(1, 50, 4)) if t[0] % 3 == 0][2:] It's almost twice as long, and doesn't exactly make up for it with readability either.
It's not "twice as long" in any syntactic sense, and readability is easily fixed: Enumerable.Range(1,50) .Where(e => e % 4 == 0 && e % 3 == 0) .Skip(1) .Select(e => e + 1) That's very understandable, it's clear what it does, and if your complaint is that dotnet prefers to name expressions like Skip rather than magic syntax, we can disagree on what make things readable and easy to maintain.
And again, you keep omitting the rest of the line. (Why?) What you should've written in response was:
var y = Enumerable.Range(1,50)
.Where(e => e % 4 == 0 && e % 3 == 0)
.Skip(1)
.Select(e => e + 1)
.ToArray();
Compare: y = [t[1] for t in enumerate(range(1, 50, 4))
if t[0] % 3 == 0][2:]
And (again), my complaint isn't about LINQ or numbers or these functions in particular. This is just a tiny one-liner to illustrate with one example. I could write a ton more. There's just stuff Python is better at, there's other stuff C# is better at, that's just a fact of life. I switch between them depending on what I'm doing.Re: The computers are fast, but you don't know it
#183On a 3GHz CPU, one clock cycle is enough time for light to travel only 10cm. If you hold up a sign with, say, a multiplication, a CPU will produce the result before light reaches a person a few metres away.
Re: The computers are fast, but you don't know it
#184Earlier quoted context omitted.
I agree except for the Python bit, which is factually wrong. Python allows you to program as if you’re a jazz pianist. You can improvise, iterate and have fun. And when you found a solution you just refactor it and use numba. Boom, it runs the same speed as a compiled language. I once wrote one little program that ran in 24 min without numba and ca. 8 seconds with numba.
Dozens of instances of a C GUI can launch in the time it takes to launch a hello world python program.
The right tool for the right job.
Re: The computers are fast, but you don't know it
#185I wonder if eventually there is going to be consideration for environment required when building software. For instance running unoptimised code can eat a lot of energy unnecessarily, which has an impact on carbon footprint. Do you think we are going to see regulation in this area akin to car emission bands? Even to an extent that some algorithms would be illegal to use when there are more optimal ways to perform a t…
To some extent they can claim to deliver a unique feature where there is no replacement for the algorithm they are using.
Re: The computers are fast, but you don't know it
#186Earlier quoted context omitted.
The author says: "The function looks something like this:" And then shows some grouping and sorting functions using pandas. Then he says: "I replaced Pandas with simple python lists and implemented the algorithm manually to do the group-by and sort." I think the point of the first optimization is you can do the relatively expenseive group/sort operations without pandas, and improve performance. For the rest of the ar…
We never get a good sense of how much time was actually saved with that change not least because the original function calls "initialise weights" inside every loop, the new function does not. It would have been interesting to see what difference that alone made. The takeaway of the article, that computers are blindingly fast and we make them do unecessary work (and often sit around waiting on I/O) with most their tim…
We never get a good sense of how much time was actually saved with that change not least because the original function calls "initialise weights" inside every loop, the new function does not.
Good point. Furthermore to your point, I would assume a library like pandas has fairly well optimized group and sort operations. It would not occur to me that pandas is the bottleneck, but the author does clarify in his footnote that pandas operations, by virtue of creating more complex pandas objects, can indeed be a bottleneck. [1] Please don't get me wrong. Pandas is pretty fast for a typical dataset but it's not the processing that slows down pandas in my case. It's the creation of Pandas objects itself which can be slow. If your service needs to respond in less than 500ms, then you will feel the effect of each line of Pandas code.Re: The computers are fast, but you don't know it
#187Earlier quoted context omitted.
Conversely when 99.9% of the software you use in your daily life is user friendly Python, having to do anything in C/C++ is a complete exercise in frustration, it feels like going back a few decades in time
As a person who uses both languages for various needs, I disagree. Things which takes minutes in optimized C++ will probably take days in Python, even if I use the "accelerated" libraries for matrix operations and other math I implement in C++. Lastly, people think C++ is not user friendly. No, it certainly is. It needs being careful, yes, but a lot of things can be done in less lines then people expect.
But I do have to say that I never managed to really get into python, it always just felt like to much of a hassle, thus I always avoided it if possible.
Re: The computers are fast, but you don't know it
#188Yup. We have gotten into the habit of leaving a lot of potential performance on the floor in the interest of productivity/accessibility. What always amazes me is when I have to work with a person who only speaks Python or only speaks JS and is completely unaware of the actual performance potential of a system. I think a lot of people just accept the performance they get as normal even if they are doing things that ta…
Agreed that switching to lower level languages give the potential of many orders of magnitude. But the thing that was most enlightening was that removing pandas made a 9900% increase in speed without even a change to language. 20 minutes down to 12 seconds is a very big deal, and I still don't have to remember how to manage pointers.
Re: The computers are fast, but you don't know it
#189Earlier quoted context omitted.
Python allows one to save development time in exchange for execution time
That's only an excuse if you're sociopathically profit-oriented. The program is developed orders of magnitude fewer times than it is run. Shitty performance, like pollution, is an externality that can be ignored but should not.
Re: The computers are fast, but you don't know it
#190Earlier quoted context omitted.
I hope one day latency in general will be "back to normal". I still remember how fast console based computing, an old gameboy or a 90's macintosh would be - click a button and stuff would show up instantly. There was a tactility present with computers that's gone today. Today everything feels sluggish - just writing this comment on my $3000 Macbook Pro and i can feel the latency, sometimes there's even small pauses.…
>Hopefully the focus on 100hz+ screens in tech Come again? I think anything beyond 60hz still qualifies as niche. Vendors are still selling 720p laptops.