The computers are fast, but you don't know it
11–20 of 819 posts
Re: The computers are fast, but you don't know it
#12Re: The computers are fast, but you don't know it
#13I've been lightly banging the drum the last few years that a lot of programmers don't seem to understand how fast computers are, and often ship code that is just miserably slower than it needs to be, like the code in this article, because they simply don't realize that their code ought to be much, much faster. There's still a lot of very early-2000s ideas of how fast computers are floating around. I've wondered how m…
Python allows one to save development time in exchange for execution time
Re: The computers are fast, but you don't know it
#14Re: The computers are fast, but you don't know it
#15And on a slightly ranty note, Apple's A12z and A14 are still apparently "too weak" to run multiple windows simultaneously :)
Re: The computers are fast, but you don't know it
#16Earlier quoted context omitted.
Most likely a missued of Pandas. DF are heavy to create, but calculations on them are fast if you stay in the numpy world and stay vectorized.
"It's fast so long as you don't use any of the many parts that aren't fast!" This isn't great.
Don't use a hammer as a screwdriver.
I'm not even implying they shouldn't have used pandas for this, I'm suggesting they probably wrote the wrong pandas code for this.
Pandas is typically 3 times faster than raw Python, not 10 times slower.
Re: The computers are fast, but you don't know it
#17Re: The computers are fast, but you don't know it
#18Hmm, interesting that single threaded C++ is 25% of Python exec time. It feels like C++ implementation might have area for improvement. My usual 1-to-1 translations result in C++ being 1-5% of Python exec time, even on combinatorial stuff.
Re: The computers are fast, but you don't know it
#19I've been lightly banging the drum the last few years that a lot of programmers don't seem to understand how fast computers are, and often ship code that is just miserably slower than it needs to be, like the code in this article, because they simply don't realize that their code ought to be much, much faster. There's still a lot of very early-2000s ideas of how fast computers are floating around. I've wondered how m…
What do those tools even do for that long? They can read enough data from the disk to overflow my computer's main memory a few times during it.
Re: The computers are fast, but you don't know it
#20It's hard to evaluate this article without seeing the detail of the "algorithm_wizardry", there's no detail here just where it would be interesting.
"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 article it's just "algorithm_wizardry", which no longer deals with that portion of the code.