Giter Club home page Giter Club logo

bullet.jl's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

sash-a

bullet.jl's Issues

Why is this lot slower than pybullet?

I have two hopefully identical scripts in python and julia using pybullet and bullet.jl and the pybullet one is much faster. I am new to julia, so hopefully I am doing something wrong, but if not could you possibly explain why python is much faster?

Julia code:

module test

# include("./Bullet.jl/deps/build.jl")
include("./Bullet.jl/src/Bullet.jl")

function testing()
    sm = Bullet.connect(kind=:direct)
    Bullet.set_gravity(sm, [0,0,-10])
    Bullet.load_urdf(sm, "./Bullet.jl/deps/usr/data/planeMesh.urdf")
    Bullet.load_urdf(sm, "./Bullet.jl/deps/usr/data/cube_larger.urdf", position=[0,0,1000])

    for i in 1:100000
        Bullet.step_simulation(sm)
    end
    Bullet.disconnect()
end

end

Python code:

def test():
    import pybullet as p
    sm = p.connect(p.DIRECT)
    p.setGravity(0,0,-10)
    plane_id = p.loadURDF("./Bullet.jl/deps/usr/data/planeMesh.urdf")
    cube_id = p.loadURDF("./Bullet.jl/deps/usr/data/cube_larger.urdf", [0,0,1000])
    
    for i in range(1,100000):
        p.stepSimulation()

    p.disconnect()

test()

Julia is timed using:

(@v1.6) pkg> activate .
  Activating environment at `~/Documents/rl/bullet_envs.jl/Project.toml`

julia> include("./test.jl")
Main.test

julia> using BenchmarkTools

julia> @btime test.testing()
  572.122 ms (27 allocations: 1.08 KiB)

Python is timed using:

python -m timeit -s "from test import test; test"
pybullet build time: May 18 2021 18:01:29
50000000 loops, best of 5: 4.56 nsec per loop

Just visually when using GUI mode the python sim goes much faster and I'd imagine it's the same for direct. There must be a reason for this, but I'm not sure what? Hopefully it's me messing up something simple within julia.

Also I've fixed the issue in #2, I you're accepting pull requests I can push it :D

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.