Live data from Hacker News

How Mojo gets a speedup over Python – Part 2

modular.com

1–10 of 66 posts

Re: How Mojo gets a speedup over Python – Part 2

#2
So TL;DR: Using SIMD and multithreading is faster than doing no optimization in python. The only real comparison here is when not doing any optimization is:

> The above code produced a 90x speedup over Python and a 15x speedup over NumPy as shown in the figure below:

Am I missing something?

Re: How Mojo gets a speedup over Python – Part 2

#3

So TL;DR: Using SIMD and multithreading is faster than doing no optimization in python. The only real comparison here is when not doing any optimization is: > The above code produced a 90x speedup over Python and a 15x speedup over NumPy as shown in the figure below: Am I missing something?

Getting >10x speed up isn’t exciting enough for many people?

I’ll take it.

This is all pretty impressive if I can take my unmodified (slightly modified?) Python code and get that sort of improvement.

Re: How Mojo gets a speedup over Python – Part 2

#4

So TL;DR: Using SIMD and multithreading is faster than doing no optimization in python. The only real comparison here is when not doing any optimization is: > The above code produced a 90x speedup over Python and a 15x speedup over NumPy as shown in the figure below: Am I missing something?

So does this mean Swift and Metal offers the same if not better performance enhancements? SIMD is very much a first class citizen as a type there

Re: How Mojo gets a speedup over Python – Part 2

#6

So TL;DR: Using SIMD and multithreading is faster than doing no optimization in python. The only real comparison here is when not doing any optimization is: > The above code produced a 90x speedup over Python and a 15x speedup over NumPy as shown in the figure below: Am I missing something?

> no optimization in python

Well, isn't that most Python? If Mojo can pave over the slow interpreted bits I repeatedly dig up in Python profilers, even well maintained projects, with no code changes, that would be huge.

Re: How Mojo gets a speedup over Python – Part 2

#8
At least they included numpy in this one. On their last post, after all their optimizations, numpy.matmul() produced almost the exact same throughput as their most optimized example. Would still need to dig in to see if this one has issues. Benchmarks are always such a minefield.

Re: How Mojo gets a speedup over Python – Part 2

#10
I don't understand the play here for Modular. If this is a worthwhile improvement that is broadly applicable, won't it at some point make it's way into Python, numpy, etc?

In Java land we had a bunch of other JVMs over the years offering better performance. Most important things got absorbed into what is now OpenJDK, and the other JVMs, if they even exist at all, are niche players.

Performance is a huge focus in Python and ML lands right now, so why would this be any different?

Post reply on HN