-
Notifications
You must be signed in to change notification settings - Fork 19
Performance issues #9
Comments
Interesting. Can you post a gist of your code (in python and julia)? |
Thanks for coming back to me so quickly! Here is my (stripped down) Julia code:
This gave me the output for N = 1000:
Output for N = 10000: I profiled the Julia code an most of the time it seemed to be spending in |
Thanks for the minimal examples. I'd also noticed performance problems before but wasn't certain they were in this repo's code or in my code that was using it. Didn't get a chance to look into it at the time. Anyway, did a little digging, think I've tracked down most of the issues. With some patches to this repo and PyCall, I have CartPole-v0 within 2x, and Pong-v4 running within 1.25x of the python speed. Will probably only get around to making PRs to the respective repos next week though. Cheers. |
I now have gym running as fast in Julia as in Python. PRs forthcoming here once JuliaPy/PyCall.jl#487 and a version of JuliaPy/PyCall.jl#486 get merged. |
I recently became interested in reinforcement learning, so I tried my luck with these environments by OpenAI. I noticed, however, quite a huge drop in performance in comparison to a Python version. On my computer 1000 runs of a random cartpole took about 16s in Julia, Python took about 4.8s for 10000 runs, which makes a factor of about 30x. With this kind of a difference it's woefully difficult to rely on Julia for these kind of simulations.
I am not very experienced in Julia; I know that calling Python from Julia isn't the fastest thing around, but are those factors usual or might I have a different problem going on?
If you need any more information or data, I'll happily provide both.
The text was updated successfully, but these errors were encountered: