T
T
Therapyx2016-10-18 17:24:14
Java
Therapyx, 2016-10-18 17:24:14

Passing and returning parameters to functions - how much does it affect performance?

Has anyone done tests or read articles about this? Whether it greatly slows down the processing of a large amount of data when passing strings to other functions and returning them back. For example, not just 1 gear, but 2, 3, 4? I never even thought about it before, but when it comes to billions of records, and still I want to have a normal program structure that can be used flexibly, if it's pasta))

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Maxim Moseychuk, 2016-10-18
@Therapyx

In java, everything except primitives is passed by reference. You save on matches.

R
Rou1997, 2016-10-18
@Rou1997

It influences, but not directly, but due to the fact that there will be more classes, and each class will "weigh" more the more functions it has, so do not take it to extremes, any architectural separation should be explained by practical tasks.

M
m0nym, 2018-07-20
@m0nym

Then take it without garbage collection.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question