Earlier quoted context omitted.
Thanks for this. Will Julia advocates every use honest benchmarks to make their language look good? I doubt it.
1000% this. Multiple times I’ve encountered a Julia benchmark claiming to show its superiority in a task I routinely perform. And every time the pro Julia benchmark turned out to be total BS.
Test for lists in Cython
131–140 of 147 posts
Re: Test for lists in Cython
#132The cython code is a bit messy. Changing from: cpdef float iterate_list(a_list): cdef double count = 0 cdef int i, j for i in range(len(a_list)): internal_list = a_list[i] for j in range(len(internal_list)): count += internal_list[j] print(count) return count To: cpdef float iterate_list(list a_list): cdef double count = 0 cdef double val = 0 cdef list ilist for ilist in a_list: for val in ilist: count += val print(c…
Thanks for this. Will Julia advocates every use honest benchmarks to make their language look good? I doubt it.
Even if it doesn't say that, bashing people who use Julia for a repository made by a Python user is a new level of HN trolling.
Re: Test for lists in Cython
#133Earlier quoted context omitted.
If join were a method on lists then you wouldn't be able to use it with other iterables. Putting it on str is more useful, if more confusing. Maybe it would be better as a standalone function. But then you'd either have to import it or it would pollute the global namespace. Other OOP models offer different solutions.
The Julia join function works on any iterable whose members are or can be converted into strings.
Re: Test for lists in Cython
#134Earlier quoted context omitted.
> Also a big downside with JavaScript. Can't Node run multiple processes (or multiple workers, not sure of the proper terminology) on multiple cores? As discussed in this thread on StackOverflow: https://stackoverflow.com/questions/61893497/node-js-on-mult...
> Can't Node run multiple processes Of course, but you can also run multiple Python processes.
Re: Test for lists in Cython
#135Earlier quoted context omitted.
Thanks for this. Will Julia advocates every use honest benchmarks to make their language look good? I doubt it.
1000% this. Multiple times I’ve encountered a Julia benchmark claiming to show its superiority in a task I routinely perform. And every time the pro Julia benchmark turned out to be total BS.
Namely, realizing these claims requires learning the language, and actually taking advantage of it's strengths rather than just writing 'python in julia'.
It's very common for Python users to show up on the Discourse forum and complain that julia is slower than python and then show some code that's basically just Python code written in julia, including a huge proliferation of global variables, allocating huge amounts of temporary arrays, etc.
There's also a huge spectrum of 'benchmark quality' out there. E.g. the benchmarks this HN post features seem pretty shitty and are not measuring anything interesting or useful as far as I can tell.
Re: Test for lists in Cython
#136Earlier quoted context omitted.
If you are genuinely hitting a wall like that surely it's time to move on from python? Or at least think about it
The thing is that the current ecosystem (numpy + scipy + pandas + PyCharm) fits our company structure perfectly (very few software engineers, mostly test engineers who are not very proficient coders). And we already have tens of thousands lines of code. So changing the whole ecosystem just because 5% of the problems are slow is too big of a jump for us. For now, it is easier for us to write a bit of C code for places…
Re: Test for lists in Cython
#137one word: pybind11 I honestly think people are severely underestimating what a massive impact this is currently having in increasing productivity of python devs who know a little C++.
Re: Test for lists in Cython
#138Earlier quoted context omitted.
Numpy operations release the GIL (usually at least) so you can use a threadpool and, indeed, share memory. Just try it and you may be pleasantly surprised. Dask is great if you’re processing large amounts of data, and it recommends and supports threads for this reason.
I didn't know that. So let's say I have 4 regular Python threads calling the same function, and in this function, let's say I call numpy.add on the same array (but different parts of the array), then will it actually use different cores for these 4 different threads? I will try it out, if it works, then that's actually great and would be super easy.