• 0 Posts
  • 5 Comments
Joined 2 years ago
cake
Cake day: June 22nd, 2023

help-circle

  • If you use the profiler and see that the slower operation is being used frequently, and is taking up a chunk of time deemed significant, why not swap it to the faster version?

    In a simulation I’m working on that goes through 42 million rounds I spent some time profiling and going through the code that was eating up a lot of time (especially things executed all 42 million times) and trying to find some optimizations. Brought the run time down from about 10 minutes to 5 minutes.

    I certainly wasn’t going to start over in C++ or Rust, and if I’d started with either of those languages I would have missed out on a lot of really strong Python libraries and probably spent more time coding rather than refining the simulation.



  • I was thinking that, too, but prior to the Sun becoming a white dwarf, the Sun is predicted to expand and swallow Earth (and Venus and Mercury), so the Sun’s mass will increase. Assuming the Sun’s expansion lasts long enough to result in those planets being vaporized I would think that additional mass would go back in when the Sun contracts into a white dwarf.

    Additionally this will mess up the orbital mass of the solar system so I could see how more asteroids (maybe even a planet?) could get dislodged from its orbit and eventually get swallowed by a dense white dwarf.

    But yeah, if the sun just instantly went to a white dwarf from its current state then orbits would probably stay pretty similar. It’s the process in between that could cause some chaos.