4,368 karma · joined December 2, 2012
Reach me at keno@juliacomputing.com
I don't see an issue about it at the moment. I guess we just expect Jacob to PR it at some point. IIRC he also wrote the Grisu implementation that's in Base.
As for your in place map example, here's how that's written in julia: https://github.com/JuliaGPU/CuArrays.jl/blob/98e32e055e96fe7...
Of course you may say that's cheating because it shifts the problem to the much more general broadcast machinery, but the implementation of that is not particularly tricky either. https://github.com/JuliaGPU/CuArrays.jl/blob/23c4c737a31aff9...
This code works with any multi-dimensional array, independent of layout considerations, though you may of course want to specialize based on layout for performance. Note also that this the code is slightly more general than the one in your example, because it handles arrays that do not have efficient linear indexing.
Also, there nothing really special about code that used to be in base, but is now in stdlib other than historical accident. It so happened that we used to ship a git client as part of the language, but the HTTP client was a separate package, despite the latter probably being a lot more useful to users. Packages can and do have their own stability guarantees. With the language itself maturing, I imagine package authors will start taking advantage of this more.
julia> @btime fact_prod(10000)
7.833 μs (0 allocations: 0 bytes)
julia> @btime fact_loop(10000)
7.908 μs (0 allocations: 0 bytes)So yeah, while the language issue is only part of the judicial reasoning, is is indeed mentioned three times in the judicial conclusions. The court does not however appear to adopt plaintiff's theory on jurisdiction because some of the volunteers were German.
As such, I'm inclined to think that while the focus on the language issue is perhaps a bit overstated in their statement, it is definitely grounded in the opinion of the court.
As an aside though, I'm not convinced the court spent too much time considering the jurisdictional arguments here, which I think are probably the most important part of this case. Most of the analysis is concerned with whether the publisher plausibly alleged they own the copyright. I assume that is because that is usually the primary point of contention in copyright cases.
- General performance analysis. For this more counters is generally incrementally better.
- Running https://github.com/mozilla/rr. This requires the retired-branch-counter to be available (and accurate - sometimes virtualization messes that up)
The second one I actually care more about, because I've pretty much stopped trying to debug software when rr is not available, too painful ;). Feel free to email me (email is in my profile) for gory details.
One thing that I think is under-appreciated in this kind of thing is that a proper C++ repl is significantly less frustrating than a debugger. GDB's C++ mode is at best a poor emulation of the C++ language. LLDB does better because it reconstructs an actual C++ AST and runs it through clang but there's still a ton of limitation (e.g. you can't call any templates or inline functions from header files).
Interactive C++ is pretty fun, especially for prototyping. The biggest problem I generally run into is that APIs in C++ are not really designed to be used in that way (esp in libraries whose user's don't use these kinds of tools). Libraries in languages with interactive prompts tend to have APIs designed in such a way that you can get the simple thing done with very little code (one call, only the arguments you need, etc), while in C++ it's a lot more common to expect user's to copy/paste a snippet from the doc and adjust all the options they want to change. That works fine in an editor, but is pretty annoying in a prompt. The other thing I often run into is error handling. A lot of C++ libraries' error handling is to just call abort() (at best) or segfault, which again is mostly fine for a compiled problem, but is annoying in an interactive setting. You can work around that of course by catching the error/resetting state, but even then you often leave libraries in the wrong state.
Regarding preallocation, you tend to want to avoid dynamic memory allocation in high performance applications anyway, so whether you do that in C++ or in Julia, doesn't really make too much of a difference. It is true this is a little harder to control in GC'ed languages than in languages where you have to do memory management manually, but the effect is about the same. Julia provides tools to figure out where you're using dynamic memory allocation and those tools will certainly improve in the future.
One thing I think is under appreciated from the performance perspective though is how easily julia lets you express data layout transformation to take better advantage of the cache hierarchy. I touched on this a bit in my JuliaCon presentation [1].
Sure would.
keno@anubis:~$ cat test2.c
void bar(int *);
int foo(int n) {
struct {
int non_terminal_val[n];
int some_other_member;
} val;
bar(val.non_terminal_val);
return val.some_other_member;
}
keno@anubis:~$ gcc -c test2.c
keno@anubis:~$ clang test2.c
test2.c:4:13: error: fields must have a constant size:
'variable length array in
structure' extension will never be supported
int non_terminal_val[n];
^
1 error generated.As for the benchmarks you posted, the worst I see Julia performing in that list is on the JSON benchmark. However, again, that's benchmarking a library. Doing high performance text parsing well is a non-trivial problem and JSON.jl isn't a super high performance library. The fact that nobody has sat down and written one yet is more of a reflection of the user community (since JSON is mostly associated with the web stack, JSON-parsing tends to be more incidental for julia users, than languages/libraries that are more focused in that area) than any performance limitation of the language - in fact I think I recently did see somebody working on a higher-performance version, but I don't have the link handy.
To summarize, it is true that some languages (or rather their implementations) are slow, causing an automatic slowdown to projects written therein, but that is generally not the case for julia (or C or Nim or Rust, etc). Once you get to that point, other things matter more, and it is important to distinguish that. In the case of Turing.jl, the linked wiki mentions that one of the primary factors impacting performance is their use of forward AD, when reverse AD would be algorithmically better. It seems understandable, that a newer project would be algorithmically less sophisticated than a more established one. However, that'll get fixed over time and the other benefits will become more and more prominent as a result.