Does JuMP work well with vectorized data?

Hello, everyone! Greetings from Brazil!

I’ve come from MATLAB in order to gain some speed regarding LP’s problems. And searching about JuMP, I found this topic Memory consumption and time of @constraint · Issue #969 · jump-dev/JuMP.jl (github.com).

It seems that JuMP doesn’t expect vectorized data and makes it slower than scalar data.
Since I just have vectorized data, should I keep using JuMP?

Also, the post was made in 2017. Maybe JuMP was modified and now works well with those two kinds of data, but I have no idea if it really was.

Thanks in advance!

1 Like

Welcome to out community! :confetti_ball:

When it comes to solving LP problems, I think the bottleneck is often the underlying solver, not the language used to interact with it. However, if you are solving many easy LPs then maybe Julia can provide some considerable speed-up.

JuMP has passed by some major changes since 2017, so there is a good change this information is outdated.

I think this depends a little on the specific solver wrapper too. However, I have to say that I already had some performance problems in the past because JuMP implements things for scalar data and then use Julia broadcast machinery for extending it to vectorized data. So, writing vectorized code is standard, easy, and legible, but in some cases it may have some performance problems. Until now, I was able to open PRs detailing my performance problems with JuMP/“the solver wrappers” and help JuMP to overcome them (proposing specialized vectorized methods that solved performance problems). I would say that you need to try it, check the performance, ask in the forums if your approach is the most optimized possible and then you will have the information to make such decision.

2 Likes