Earlier quoted context omitted.
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.
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.
JNumPy: Writing high-performance C extensions for Python in minutes
41–50 of 66 posts
Re: JNumPy: Writing high-performance C extensions for Python in minutes
#42Unless I'm misunderstanding, this seems to be writing python extensions in Julia not C. So quite a misleading title. Also why should I pick this over cython, pythran or numba? with those I don't need to learn how to optimise another language (and no just writing Julia code does not necessarily get you large speed ups and certainly not the speed of C in many cases). I really wish the Julia community would stop oversel…
Re: JNumPy: Writing high-performance C extensions for Python in minutes
#43Earlier quoted context omitted.
I did a comparison of Julia vs numpy, cython and pythran [1] some time ago, for a typical dsp routine we use in our work, and Julia was quite a bit slower than the alternatives. Now I'm by no means a Julia expert so I might have missed an optimisation opportunity (although I posted this and nobody could point to something obvious) , however the whole advertisement behind Julia is that one gets essentially C speed wit…
wxy[:,:,k] += mu*conj(err[i,k])*X This should probably be wxy[:,:,k] .+= mu*conj(err[i,k]).*X so allocations are avoided. This doubled the speed for me, although I don't what size inputs are realistic. The @benchmark and @profile macros are good for this stuff.
Re: JNumPy: Writing high-performance C extensions for Python in minutes
#44Earlier quoted context omitted.
This is why it's a C extension: https://github.com/Suzhou-Tongyuan/jnumpy/blob/main/TyPython... The title is correct because it is a Julia numpy interface. Inside it seems is another project, TyPython, that provides an efficient Julia-Python-Numpy bridge, via C extensions.
I would argue that it might technically be correct (and admittedly that's the best type of correct) in the strict sense, it is also misleading. If I read that I'm writing C extensions in minutes I at least expect that the extension compiles to C (which the Julia code doesn't).
Re: JNumPy: Writing high-performance C extensions for Python in minutes
#45Earlier quoted context omitted.
What’s your point?
The point is that when adgjlsfhk1 doubts that Julia is slower than C, he does so from a background where "data" is a synonym for arrays of numbers, and "computing" means processing these arrays. Julia shines here, precisely because the people developing Julia have a similar focus. In contrast, if your performance bottlenecks are IO, parsing and hash table operations, then Julia's performance will be in par with Pytho…
Though I agree parsers haven't gotten much love in Julia. That said, this repo is saying it's for implementing NumPy extensions, and I don't think NumPy has many parsers it's using.
Re: JNumPy: Writing high-performance C extensions for Python in minutes
#46it's a breeze to use, header only.
Re: JNumPy: Writing high-performance C extensions for Python in minutes
#47Unless I'm misunderstanding, this seems to be writing python extensions in Julia not C. So quite a misleading title. Also why should I pick this over cython, pythran or numba? with those I don't need to learn how to optimise another language (and no just writing Julia code does not necessarily get you large speed ups and certainly not the speed of C in many cases). I really wish the Julia community would stop oversel…
I wish they would stop overselling too. There are so many problems with trying to adopt it for real projects it isn't even funny... Good for researchers sometimes, but even then... It's got issues. Pretty toxic community too.
Quite the opposite according to my own experience.
Re: JNumPy: Writing high-performance C extensions for Python in minutes
#48Earlier quoted context omitted.
The point is that when adgjlsfhk1 doubts that Julia is slower than C, he does so from a background where "data" is a synonym for arrays of numbers, and "computing" means processing these arrays. Julia shines here, precisely because the people developing Julia have a similar focus. In contrast, if your performance bottlenecks are IO, parsing and hash table operations, then Julia's performance will be in par with Pytho…
Some of these are just safety-by-default things. For example, IO in Julia is thread-safe by default, which I think is a good idea because safety-first programming is good for say throwing `print` into a threaded loop written in the REPL. Here for example, https://github.com/aaronang/stl-benchmark/pull/3 , was a case where Julia saw a performance hit from C++ and I was curious and tracked it down to this locking-by-de…
Re: JNumPy: Writing high-performance C extensions for Python in minutes
#49Earlier quoted context omitted.
Do you have any source on well written julia being any slower than well written C?
I did a comparison of Julia vs numpy, cython and pythran [1] some time ago, for a typical dsp routine we use in our work, and Julia was quite a bit slower than the alternatives. Now I'm by no means a Julia expert so I might have missed an optimisation opportunity (although I posted this and nobody could point to something obvious) , however the whole advertisement behind Julia is that one gets essentially C speed wit…
For someone outside the field of DSP, please note that your post gives no context to the problem, nor to the input data. It's pretty hard to optimize something when we don't understand the structure of the problem or the input, and what exactly the code is trying to accomplish.
I remember taking a look at the post when it was posted some time ago, and having to give up pretty quickly because it was hard to make sense of it (in any language), and it seemed like I had to install specific Python libraries to (- hopefully, if everything works -) generate the input data. That takes it beyond "fun little optimization diversion to the day" to something that feels like work.
(Also, to anyone who hasn't read the post, I'll note that somebody did point to something obvious, as mentioned in the update to the post - a single suggestion that only needed superficial understanding of the code, that lead to a 3x speedup from OP's original Julia code.)
FWIW, someone with some domain knowledge on the Julia Discourse [1] was able to generate the input data, and posted code that they claim should be faster. They only mention the run time of the new code - 9 ms - so I don't know if, and by how much, it is faster in comparison. (Note that the code uses global variables at the end - which is fine there since they're using `@btime` and `$`s, but if using `@timed` instead, those should be enclosed in a `main` function or a `let` block.)
[1] https://discourse.julialang.org/t/this-post-claims-that-juli...
Re: JNumPy: Writing high-performance C extensions for Python in minutes
#50Unless I'm misunderstanding, this seems to be writing python extensions in Julia not C. So quite a misleading title. Also why should I pick this over cython, pythran or numba? with those I don't need to learn how to optimise another language (and no just writing Julia code does not necessarily get you large speed ups and certainly not the speed of C in many cases). I really wish the Julia community would stop oversel…
I wish they would stop overselling too. There are so many problems with trying to adopt it for real projects it isn't even funny... Good for researchers sometimes, but even then... It's got issues. Pretty toxic community too.
Can you expand on that, so that it's possible to improve on them?