Questions tagged [memory-optimization]
Memory Optimization is a subset of Optimization: it is the goal of reducing the memory consumption (the amount of memory used during compile or run time) of your program or of a specific algorithm
236
questions
-4
votes
0
answers
51
views
Tetris C++ Troubles with memory leaks | code provided [closed]
Memory Loss in My Tetris Game 😓
Hey everyone,
I'm pretty new to C++ and this is my first post on Code Review, so I really appreciate any help all of you can provide. I've been working on a Tetris ...
3
votes
2
answers
58
views
Optimizing a Function to Generate a Row of Consecutive Odd Numbers in a Triangle
I've written a JavaScript function that generates a row of consecutive odd numbers in a triangle. The triangle looks like this:
...
2
votes
1
answer
80
views
Generic container wrapper type with a default underlying buffer (2nd rev)
This is a revision of the previous question. I was told to ask an additional question with more context for the modified code to be reviewed.
The changes:
changed from ...
2
votes
1
answer
69
views
Autocompletion trie for English words in zig
I am trying to write a program that creates a Trie from a list of all English words, and then when run provides completions for a given prefix. Basically for each node I allocate a list of 255 null ...
5
votes
4
answers
1k
views
Optimized Python Solution for Determining if an Array Contains All Possibilities
Problem:
You have been tasked with writing a method named is_all_possibilities (or IsAllPossibilities, as per your preference) ...
2
votes
1
answer
50
views
A collection based on a bitset to store a set of unique integers from a given range (rev. 3)
All right, let's do this one last time.
This is continuation of this review.
I applied most of the proposed changes, making interface of my container very close to that of ...
4
votes
1
answer
80
views
A collection based on a bitset to store a set of unique integers from a given range (rev. 2)
This is a continuation of this review. I applied most of the proposed changes.
These changes were focused mostly on decoupling the class from the rest of the program and making its interface more like ...
1
vote
1
answer
79
views
Collection that uses a bitset to store a huge set of unique integers from a given range (rev. 1)
Some (skippable) context:
I'm writing program that minimizes an arbitrary logical function. Such function takes an unsigned integer as an argument and returns either ...
9
votes
1
answer
292
views
Construct a performant sieve of Atkin in Rust
I have implemented the sieve of Atkin in Rust. It can find all primes till 1,000,000,000 in 4.5 s using 34.4 MiB on my 1.4 GHz machine. This is a direct implementation (with some optimisations made ...
2
votes
3
answers
213
views
Prevent stack memory usage for recursive function in C
This C code does DBSCAN - Density-based spatial clustering of applications with noise. It's a cluster algorithm for turining unsupervised (no labels) data to become ...
2
votes
3
answers
737
views
Find median value of two Sorted Arrays
To improve my coding knowledge can you please give me suggested changes on my code?
...
2
votes
4
answers
179
views
Comparison of two excel files ignoring line order
Below is a simple method which compares contents of two excel files ignoring the line order.
This method is working as expected.
But, one of my peers in their code review mentioned that initializing ...
0
votes
1
answer
50
views
Aggregate transactions in slips
I wrote code to aggregate transactions in slips. I'm concerned with the performance of my code because it uses 3 loops that are nested so the time complexity will be cubic. This code won't scale well ...
6
votes
1
answer
1k
views
Simple stack allocator in C
My plan is to allocate a fixed amount of static memory at initialization (a few MBs), and use a stack allocator for quick temporary buffers. The idea is to avoid calls to ...
5
votes
2
answers
645
views
Construct mesh from a point cloud
I have been developing a program with C lately, its purpose over the top is to reconstruct meshes from point clouds which are generated by finding the intersection points of numerous rays fired at the ...