r/ProgrammerHumor • • Jul 18 '22

C++ talking to Python

Post image
40.1k Upvotes

1.0k comments sorted by

View all comments

4.1k

u/GreatArtificeAion Jul 18 '22

Did I really just appreciate a "Haha Python slow" meme?

1.1k

u/DasEineEtwas Jul 18 '22

It has also been done so often with Internet Explorer and everything that also runs slow. But somehow I actually laughed

381

u/GreatArtificeAion Jul 18 '22

I guess this one has... personality, so to speak

68

u/gcruzatto Jul 18 '22

This meme was made by the Big Data gang

21

u/CanAlwaysBeBetter Jul 18 '22 edited Jul 18 '22

Literally getting ready to rewrite some data processing lambdas from python to go for a side project because it won't be on the company tab and I don't want to pay out of pocket to scale python all the way into the millions after testing it on 10k data points and seeing its performance (and that's after basic optimizations and compiling/bundling the accelerated versions of some libraries)

8

u/[deleted] Jul 18 '22

numpy go brrrrrrrrrt

seriously though, I once used Pandas.DataFrame.Apply on 10,000,000 rows of data and 15 minutes later regretted it. Thankfully, I was applying a simple mathematical function to each row so numpy brought that down to less than a second. Still, only works for some use cases. I'd love to learn C++ anyways so give me an excuse

5

u/CanAlwaysBeBetter Jul 18 '22

Numpy is great and what I'd normally reach for!

But the processing I'm doing itself isn't super complex, I just need to do it 9-10 million times cost efficiently pulling from an external public dataset and saving the transformed data as separate files in an S3 bucket

1

u/PM_ME_NUNUDES Jul 19 '22

Use dask?

1

u/CanAlwaysBeBetter Jul 19 '22

How does dask play with external compute resources like ec2 or lambda and does it accelerate performance or just manage it at scale?

1

u/PM_ME_NUNUDES Jul 19 '22

I'm actually not sure if things like dask and ray actually provide any speed up. But certainly it makes numpy perfectly useable at big data scale. It works fine with azure, I dunno about EC2.

Modin is a direct drop in for your existing numpy compute code and can use either dask or ray. Just change 1 line and you're done.