News for hackers. Stuff that matters.
Re:Why Is Python Growing So Quickly? by Sohcahtoa82 on Thursday September 14, 2017 @02:00PM (#15250685)
> One of my clients recently replaced a major chunk of their C++ code with Python and achieved a speedup from multi-hour to sub-millisecond.

I'd really like to know what they were doing and how they could do it so wrong that the C++ version took hours while the Python version was faster than a blink of the eye.

Re:Why Is Python Growing So Quickly? by goatlover on Thursday September 14, 2017 @02:47PM (#15251181)
Good question. I did have a situation where looping over a fairly large Pandas dataframe took 12 minutes, but using the underlying numpy values took only 3 seconds. The looping was required to do complicated row and column operations.

Similarly, naybe the C++ code was using an inefficient data structure for a large dataset compared to using something like Numpy.

Re:Why Is Python Growing So Quickly? by xapata on Thursday September 14, 2017 @06:20PM (#15252967)
It had to do with the number of dimensions and combinations that were being looped over. That kind of scale difference generally comes from combinatoric explosion -- exponential or high polynomial time vs linear or log-linear time.

The rewrite realized an approximation was reasonable in place of a more "correct" algorithm.

Note that I'm not saying Python was the cause, but the ease of reading and writing code may have helped the programmer come to this algorithm. Instead of stressing about bugs and deadlines. Algorithm choice seems correlated with language choice, in my experience.