A
A
Alexey Lebedev2014-06-24 15:29:00
Search Engine Optimization
Alexey Lebedev, 2014-06-24 15:29:00

What is the best way to store numbers in C#?

Now there is such a scheme:
1) Numbers are taken from the database and stored in the string variable
2) Other queries are executed (Update, Insert)
3) Numbers are displayed on the screen.
In general, this works for more than one year. But recently, one person told me that I need to convert all numbers to int, since they take up less space.
The numbers are mostly positive from 10,000,000 to 1,000,000,000.
Which is more profitable:
1) store intermediate data as strings.
2) store in int, but always do Int32.Parse (int) and +
These are small things, but I want to do it right.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
CAMOKPYT, 2014-06-24
@swanrnd

Fuck it, this is unnecessary bullshit. After all the optimizations, you will win 1kb of memory, which will be more than covered by uncollected garbage.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question