7 ms·
I'm a big fan of Julia. It does live up to its speed claims. I've implemented the board game Go in Python, Rust, and Julia and Julia is definitely closer to Rus
by Buttons840 5y ago
I'm a big fan of Julia. It does live up to its speed claims. I've implemented the board game Go in Python, Rust, and Julia and Julia is definitely closer to Rust in speed. Same algorithms were used for all implementations.
Julia's time to first plot still has some problems. The Plots library can build animations, but the time to first animation on my computer is like 10 minutes, and the time to second animation is another 10 minutes. Probably just a bug, I haven't found any other case that takes so long.
I've also mentioned before that a reinforcement learning algorithm I ported from Python/PyTorch to Flux was faster, not because of training times, but because of all the other stuff (and RL has more "other stuff" than supervised learning) that goes on outside the core training loop is so much faster.
- throwaway894345 5y ago> I've implemented the board game Go in Python, Rust, and Julia and Julia Oof. I reread this several times consecutively as "I've implemented the board game in Go, Python, Rust ...".
- dunefox 5y ago> but the time to first animation on my computer is like 10 minutes Have you tried 1.6 already? I find it's substantially faster.
- Buttons840 5y agoYes, I was doing it just this week with Julia 1.6.
- vavooom 5y agoDo you have any documentation / Github repos where you build those Go implementations? I am a huge fan of the game and would be curious to see how you built it, specifically in Python / Julia.
- Buttons840 5y agohttps://github.com/DevJac/gobot https://github.com/DevJac/gobot https://github.com/DevJac/julia_gobot https://github.com/DevJac/julia_gobot
- clarkevans 5y agoMultiple dispatch and generic programming make Julia a productive language to work with. However, a given program may have unnecessary function specializations (which affect startup compile time) or unexpected dynamic dispatches (which affect runtime performance). These can be addressed with some important development patterns: checking for type stability via @code_warntype, using opaque structs or @nospecialize when appropriate, etc. I've found the Julia community to be very helpful with regard to performance on the forums, slack, and zulip.
- ku-man 5y agoThis is exactly the problem with Julia, to achieve those (soo much vaunted) c-like-speeds you need quite a few contortions.
- eigenspace 5y agoI don't think those contortions are all that crazy compared to what you have to do in C though anyways. And you can choose where to spend your effort in optimizing functions. Sometimes, a function really is performance critical so you spend a ton of time fiddling with it to make it blazing fast, other times you write something non-optimal but straightforward. It's all the same language though, and unlike tools like Cython, you don't lose all your nice high level language features when you drop down to 'high performance julia code'.
- xiaodai 5y agowhat's your ogs id? I challenge u
- lmm 5y ago> I'm a big fan of Julia. It does live up to its speed claims. I've implemented the board game Go in Python, Rust, and Julia and Julia is definitely closer to Rust in speed. Same algorithms were used for all implementations. "Closer to Rust than to Python" is a wide range. Almost any non-scripting language (e.g. Java, OCaml, Haskell, Dylan...) would qualify, and that's normally not enough to give them a reputation as "fast".
- cjalmeida 5y agoI’ve implemented some graph traversing algos in Julia and 100x faster than Python. Really in the same ballpark of C++, but much simpler code.
- lmm 5y ago> 100x faster than Python. Really in the same ballpark of C++, but much simpler code. One could say the same for any of the languages I listed (maybe not "much simpler code" in the case of Java).
- oscardssmith 5y agoIf you want a harder guarantee, well written numerical code will be as fast as any other language. If you find a counter example, let us know (it's probably something that should be fixed). For string processing and other gc heavy code, Julia has further to go. Julia's gc is pretty basic, and needs a lot of love. That said, for dataframes like workloads, Julia usually manages to hand with the best (data.table), and it's rarely much slower.
- lmm 5y agoMy assumption is that there's nothing outstanding or remarkable about Julia's performance. Comparing to Python/Perl/Ruby/TCL is a good way to make any language seem fast, and comparing to C++ is a good way to make any language seem expressive. I'd be far more interested to hear about comparisons with alternatives that might actually be competitive - non-scripting languages with a reputation for being expressive, such as ML-like functional languages, or recent general-purpose languages like Swift/Kotlin/C#.