All Questions
Tagged with c efficiency
8 questions
1
vote
2
answers
2k
views
Efficient Repeating Alarm Clock in Low Level Language like C
I was thinking about it and I was curious as to how one would code an efficient repeating alarm clock in C? Would you set an alarm time and then offset the time with the ms time equivalent of a day (...
1
vote
2
answers
209
views
Multi-pattern matching
I have a given byte array in C and I need to match it against several byte arrays and return true if there is any match.
I can make various memcmp's but I feel that it is very inefficient.
Do you ...
6
votes
2
answers
1k
views
Bottleneck performance in ECS
I've been looking into building an entity-component-system. Basically, an entity is just an id wrapped around a struct, components are data belonging to that entity(and reference said id), and systems ...
29
votes
11
answers
11k
views
When I test out the difference in time between shifting and multiplying in C, there is no difference. Why?
I have been taught that shifting in binary is much more efficient than multiplying by 2^k. So I wanted to experiment, and I used the following code to test this out:
#include <time.h>
#include &...
20
votes
7
answers
6k
views
Does modular programming affect computation time?
Everyone says that I should make my code modular, but isn't it less efficient if I use more method calls rather than fewer, but larger, methods? What is the difference in Java, C, or C++ for that ...
2
votes
1
answer
362
views
Effective handling of variables in non-object oriented programming
What is the best method to use and share variables between functions in non object-oriented program languages?
Let's say that I use 10 parameters from DB, ID and 9 other values linked to it. I need to ...
6
votes
3
answers
2k
views
Starting on a large project, should I split it into more concise parts?
Background: Currently an intern at a company and working on repurposing older programs (still in use, but for different departments) for use in testing new hardware. The new hardware is different in ...
6
votes
6
answers
6k
views
Programming languages differences and efficiency, does it matter?
I am fairly new to programming, I have studied in computer science for 3 years at college, but as you know, school is only 2% of what really makes one a fully-fledged programmer.
I have a lot of ...