Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
pypy
pypy
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 584
    • Issues 584
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 11
    • Merge Requests 11
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • PyPy
  • pypypypy
  • Issues
  • #3349

Closed
Open
Opened Nov 24, 2020 by Pierre Augier@paugier

Efficient NBody implementation on PyPy

Sorry to write this here. It's not really a PyPy issue and I guess an email would have been better, but it's simpler for me here.

I'm working on writing efficient implementations of the NBody problem https://github.com/paugier/nbabel to potentially answer to this article https://arxiv.org/pdf/2009.11295.pdf.

I also try to write a code efficient for PyPy but I don't get very good results. My first attempt was with pure OOP Python (https://github.com/paugier/nbabel/blob/master/py/bench_purepy.py). It's much faster than for CPython but much slower than with other solutions.

Then, I tried to write something with structures closest to arrays. Since I understood that lists of floats can be contiguous in memory with PyPy, I tried with lists (https://github.com/paugier/nbabel/blob/master/py/bench_pypy.py). However, it is very slow with PyPy (slower than the OOP solution).

Am I doing something stupid? Can we get better results with PyPy?

Moreover, I tried to use mvprof but it wasn't very useful (the website seems down and the terminal output wasn't very helpful).

To upload designs, you'll need to enable LFS and have admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: pypy/pypy#3349