аватар question@mail.ru · 01.01.1970 03:00

How to make the program on Python work in the background? [closed]

. The answers to it are not accepted at the moment.

& nbsp;

want to improve this question? 3 years ago .

there is, which copes well with relatively small numbers, but when the numbers increase, the program eats up the whole Memory makes my processor painful.

I want to rewrite the program so that it stores objects in the database and perform actions on objects in the background. At the same time, I want to limit the resources consumed by the program so that it does not load the processor much and does not eat a lot of memory.

аватар answer@mail.ru · 01.01.1970 03:00
  • A separate process is to look either at the Threading module or Multiprocessing.
  • you are not required to store all the data in your memory, and if we are talking about string resources, you can attract the Ziplib module, or write down and read data from the file portions.
  • If you read from the file-you can store the ZIP file in your memory-the mmap module to you to help you.
  • Cython expansion will help you reduce your memory consumption by 5-8 times, and accelerate your calculations by 5-140 times. Russian. Do not use complex specific constructions. Do not sin with hidden attributes (they are used differently).
  • Latest

    Similar