U
U
Urukhayy2015-04-02 16:52:21
Programming
Urukhayy, 2015-04-02 16:52:21

What resources to "save" in algorithmization?

Let's say there is a task. And of course there are many ways to solve this problem. It is also natural that you need to find the most optimal way.
Well, in fact, there are situations when the choice before the optimal solution falls on the "saving" of RAM resources or the "saving" of processor resources.
There is a lot of controversy and nuance here. After all, if you "save" RAM, then you will have to adjust the algorithms so that you can do without variables (if the task paths imply this). In this case, we will have to describe functions, and sometimes not small ones. And if the task allows you to reduce processing, and at the same time increase the number of variables, then the picture is already different.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
Maxim Kudryavtsev, 2015-04-02
@Urukhayy

The task of "saving" technical capacities arises in three cases:
From my point of view, the code written by you should first of all be understandable to another developer, it should be easy to read, possibly expandable. If the client is faced with the choice "Hire a developer for 1k USD/month or rent another server for his project for 250 USD/month", then I doubt that he will choose the first option, except for case No. 1 from the list above .

S
Saboteur, 2015-04-02
@saboteur_kiev

The task of a programmer is not to write algorithms, but to solve specific problems by writing algorithms.
Once you prioritize correctly, you will understand what and when to save.

S
Sergey, 2015-04-02
Protko @Fesor

and increase the number of variables

Maybe increase memory consumption? The number of variables here does not really matter. And then there are caches, multithreading, vectorization of calculations.... let's say sometimes it happens that two cycles are faster than one, although it may seem that it should be different.
Anyway, it all depends on the programming language and compiler.
According to the algorithms themselves, one can only predict the complexity on very large amounts of data and proceed from this.

F
FoxInSox, 2015-04-02
@FoxInSox

When and how depends on the case.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question