Linked Questions
94 questions linked to/from Is micro-optimisation important when coding?
1
vote
2
answers
327
views
Is it a good practice to allocate memory size to data types?
I'm learning rust and curious to know the purpose that we can allocate memory sizes to data types. I'm not clear yet how this could be an advantage. It can definitely save up some memory space but I ...
0
votes
3
answers
298
views
Java code quality in methods calling methods
I am currently working with an "interesting" code-base and see the following type of thing alot in the code.
public Object doSomething()
{
Object obj = new Object();
// Do some stuff to the ...
0
votes
1
answer
382
views
Erlang: Memory implications of passing around large objects in/to functions
Is there a memory penalty to passing around large objects (like an entire http request, or the blob contents of an uploaded file) between functions within the same (Erlang) process?
It is my ...
-1
votes
1
answer
574
views
Split object into multiple objects while keeping reasonable performance
I'm using C# but the problem could also be with Java.
I have an object in the flow that is muted for setting up some properties during the flow of the program.
Let say
public class Person {
public ...
-2
votes
1
answer
504
views
Avoiding multiple calls to SQL and persist data
I often received messages objects and for each of them I need to query the database in order to achieve some additional information from one database table. Since we are performing many requests to ...
-2
votes
1
answer
597
views
Optimal Data Structure for Searching though String
I am current developing a karaoke app in JavaFX, I need advise on the most optimal data structure storing a huge list of songs (library). I am inclined to use Binary Search Trees due to its Big O ...
-4
votes
1
answer
592
views
In terms of performance and memory usage, which is better in storing objects: Dictionary or List?
I want to know if it's faster and more efficient to store and access objects in a nested dictionary Dictionary<string, Dictionary<string, int>> VS List<Object>. Though adding objects ...
-6
votes
2
answers
321
views
Which piece of code is more efficient with respect to Time and Memory cost? [closed]
Code 1:
private static int myCompare(String a, String b) {
/* my version of the compareTo method from the String Java class */
int len1 = a.length();
int len2 = b.length();
if (...
1
vote
1
answer
426
views
logger initialization in JEE based web application
While working on a web (JEE based) application I saw some different ways people have instantiated loggers in different classes. First way is classic way like,
private static final Logger logger = ...
1
vote
1
answer
329
views
How should I approach the comparison of two BMP images?
I am currently writing a Python program that retrieves the pixels from two BMP files and finds the percent difference between them (without using the Pillow library for the purpose of learning). I can ...
-4
votes
4
answers
410
views
Splitting one class into subclasses to save memory
Suppose that you describe programs, which have a lot of AssignmentStatement(target, /*value*/Expression). There are other statements, like if-statement and for-statement and all of them may have ...
-4
votes
2
answers
176
views
Which one of the two is efficient?
I have been reading a blog where the author has mentioned the below two styles of coding.
Min and Max 1
int min = Integer.MAX_VALUE;
int max = Integer.MIN_VALUE;
for (int x : array) {
if (x < min)...
-2
votes
1
answer
234
views
Best way to deal with lots of nested closures in Swift
I have some external SDK library that makes IO calls (either networking or database) in the form of blocks, like so:
SomeClass.doWork(success: {}, failure: {})
Now I need to chain about 60 different ...
0
votes
1
answer
90
views
Does variable type specification lead to any performance difference?
Let's say I have a very long method which basically creates a responsive and resizable layout for a user interface by using a few fixed values and a few variable ones taken from an element's ...
0
votes
3
answers
289
views
Is there any technical reason to be concerned with casting speed?
So, I'm working on a project that takes a very complex entity from a third party framework and converts it into the native object that defines that entity. This entity has several one-to-many ...