News for hackers. Stuff that matters.
Re:JNumPy: Writing high-performance C extensions for Python ... by TekMol on Wednesday August 10, 2022 @02:03AM (#32408263)
Python itself has to become faster.

For the love of god. Make it as fast as PHP.

My biggest pain point in computer science is that for every project I have to decide to either cope with PHP's butt-ugly namespace system or with Python's masochistic slowness.

Please, Python developers. Take a closer look at how PHP achieves its speed, hold all other development and copy whatever they do!

The result would be heaven.

Re:JNumPy: Writing high-performance C extensions for Python ... by anewhnaccount2 on Wednesday August 10, 2022 @02:15AM (#32408332)
Re:JNumPy: Writing high-performance C extensions for Python ... by TekMol on Wednesday August 10, 2022 @02:43AM (#32408480)
It seems to indicate a 30% performance boost?

That would be a step into the right direction.

6 more 30% improvements and it is on par with PHP.

Re:JNumPy: Writing high-performance C extensions for Python ... by lraxl on Wednesday August 10, 2022 @04:18AM (#32409155)
It will yield a small speedup (< 50%) at best, probably for selected benchmarks that will be widely promoted.

Microsoft is misallocating its resources. The scientific ecosystem should be ported to .NET, with first class support for F#.

Re:JNumPy: Writing high-performance C extensions for Python ... by jeremycarter on Wednesday August 10, 2022 @06:15AM (#32409793)
.NET would be the perfect ecosystem. And for those who love their dynamic there is support for that too.
Re:JNumPy: Writing high-performance C extensions for Python ... by machinekob on Wednesday August 10, 2022 @05:30AM (#32409547)
They already try it like 2/3 times and it didnt take off so why should it be different today?
Re:JNumPy: Writing high-performance C extensions for Python ... by melony on Wednesday August 10, 2022 @10:50PM (#32420979)
Everytime they did it, it was half baked at best. Scientific libraries need driver support, Microsoft always takes the happy path and ignores all the other hardware permutations. If you are not running Intel/Nvidia in a Win32 environment you are out of luck. WSL2, ARM, AMD, etc. don't have much synergy in terms of product support.
Re:JNumPy: Writing high-performance C extensions for Python ... by quietbritishjim on Wednesday August 10, 2022 @12:32PM (#32414712)
> ... for every project I have to decide to either cope with PHP's butt-ugly namespace system or with Python's masochistic slowness.

Good news: there are more than two programming languages!

But seriously, what situation are you in where your only choices are Python and PHP?

Re:JNumPy: Writing high-performance C extensions for Python ... by cardanome on Wednesday August 10, 2022 @03:47AM (#32408918)
Wait, you are using PHP for scientific computing? I would love to hear more about that part.

That could actually work out nicely with the right libraries, just haven't yet heard of anyone doing that.

I think Python is inherently difficult to optimize because it allows some dynamic trickery that PHP does not. Additionally being large and complex does not help. You can't really pull an LuaJit equivalent. There sure are still many quick wins to be made for Python performance but not sure if it will ever compete with PHP/Lua/Julia and others on the performance front.

Re:JNumPy: Writing high-performance C extensions for Python ... by pbowyer on Wednesday August 10, 2022 @05:21AM (#32409502)
> Wait, you are using PHP for scientific computing? I would love to hear more about that part.

Not OP but I wish PHP was usable for scientific computing.

If I had better C/Rust/PHP internals insane macro skills I would integrate a dataframe library (Pola.rs?) into PHP to give us the basics for manipulating data.

Plenty more to add after that for matrix multiplication and the rest but I haven't thought that far ahead!

Re:JNumPy: Writing high-performance C extensions for Python ... by adgjlsfhk1 on Wednesday August 10, 2022 @02:19AM (#32408353)
would python being 3x faster make a difference? you'd still have so call out to an actually fast language when you want your code to be fast.
Re:JNumPy: Writing high-performance C extensions for Python ... by TekMol on Wednesday August 10, 2022 @02:40AM (#32408467)
A 3x faster Python would make it about 2x slower than PHP.

That is way easier to digest than the current ~5x performance penalty for using it.

I would probably not consider PHP anymore if Python was 50% of its speed.

I would never consider anything else than Python or PHP for web projects. Developer time is more precious than CPU time.

Re:JNumPy: Writing high-performance C extensions for Python ... by peaky_blinder on Wednesday August 10, 2022 @04:04AM (#32409048)
You can have small developer time with other technologies too (JavaScript, Go, Elixir etc) and get some additional benefits compared to PHP. Honestly I don't see the reason to use PHP today unless you have to;

1. Maintain existing PHP codebase

2. Your team only knows PHP

Re:JNumPy: Writing high-performance C extensions for Python ... by TekMol on Wednesday August 10, 2022 @05:02AM (#32409417)
Except for speed, PHP has another awesome thing going for it: Statelessness.

You throw some PHP files on a server and have a working web application. As soon as you change a PHP file, the change is in effect on next reload of the page. You might be able to do the same in Python, but everybody in Python world is doing the long running thread approach, so you would be on uncharted territory.

Re:JNumPy: Writing high-performance C extensions for Python ... by rowanG077 on Wednesday August 10, 2022 @06:31AM (#32409886)
If you want to optimize for developer time you should look at statically typed languages with rich type systems that have little overhead.