Questions tagged [efficiency]

Use this tag in reference to comparing the efficiency of various systems or algorithms, or methods to measure efficiency. Big O notation is more related to complexity, but could affect efficiency.

Use this tag in reference to comparing the efficiency of various systems or algorithms, or methods to measure efficiency. Big O notation is more related to complexity, but could affect efficiency.

180 questions
83
votes
7 answers

Why are bit masks called "masks" and what purpose do they serve?

Why are "bit masks" called like this? I know that they are mainly used for bitwise operations and the usage of bit masks is more efficient than the usage of separate variables. However my question is why and when were bit masks invented? Were they…
yoyo_fun
  • 2,267
  • 3
  • 17
  • 22
82
votes
5 answers

Is Python Interpreted or Compiled?

This is just a wondering I had while reading about interpreted and compiled languages. Ruby is no doubt an interpreted language since the source code is processed by an interpreter at the point of execution. On the contrary C is a compiled…
crodjer
  • 1,039
  • 1
  • 9
  • 10
78
votes
11 answers

Metric by which to hold developers accountable

I asked a question on lines of code per hour and got torn a new one. So my matured follow-up question is this: If not lines of code, then what is a good metric by which to measure (by the hour/day/unit-of-time) the effectiveness of remote…
Kyle Cureau
  • 913
  • 1
  • 6
  • 10
66
votes
4 answers

Is it wasteful to create a new database table instead of using enum data type?

Suppose I have 4 types of services I offer (they are unlikely to change often): Testing Design Programming Other Suppose I have 60-80 of actual services that each fall into one of the above categories. For example, 'a service' can be "Test…
Dennis
  • 8,157
  • 5
  • 36
  • 68
44
votes
10 answers

Why not have a High Level Language based OS? Are Low Level Languages more efficient?

Without being presumptuous, I would like you to consider the possibility of this. Most OS today are based on pretty low level languages (mainly C/C++) Even the new ones such as Android uses JNI & underlying implementation is in C In fact, (this is a…
41
votes
10 answers

Is there any hard data on the (dis-)advantages of working from home?

Is there any hard data (studies, comparisons, not-just-gut-feel analysis) on the advantages and disadvantages of working from home? My devs asked about e.g. working from home one day per week, the boss doesn't like it for various reasons, some of…
peterchen
  • 1,127
  • 8
  • 15
41
votes
3 answers

Is there any reason to use varchar over text columns in a database?

Is varchar just a remnant from before text came around, or are there use cases where you would want to use a varchar? (Or char for that matter..) (I use Postgres and MySQL (MyISAM) daily, so those are what I'm most interested in, but answers for…
Izkata
  • 6,048
  • 6
  • 28
  • 43
33
votes
4 answers

I am spending more time installing software than coding. Why?

I am developing code mainly using Bash, C, Python and Fortran and recently also HTML/CSS+JavaScript. My OS is Ubuntu. Maybe I am exaggerating, but I figured that I kind of spend more time getting software (Debian and Python packages mainly,…
29
votes
5 answers

At what point is asynchronous reading of disk I/O more efficient than synchronous?

Assuming there is some bit of code that reads files for multiple consumers, and the files are of any arbitrary size: At what size does it become more efficient to read the file asynchronously? Or to put it another way, how small must a file be for…
blesh
  • 899
  • 1
  • 9
  • 15
28
votes
18 answers

Why companies don't buy developers entertaining instruments?

Many times when I get tired of development and my mind doesn't really help me any more (at home), I simply do something entertaining and my mind gets free for more hours of work with higher problem-solving capacity. However, when I recommended this…
Rasoul Zabihi
  • 539
  • 4
  • 10
28
votes
7 answers

What arguments are there against easter eggs? Are there any arguments to even support easter eggs?

I'm a bit of a jester so the idea of an easter egg still appeals to me. I have added them in my code before but my group of friends has a running joke of using CTRL-FU to trigger the egg. Now I'm also a bit paranoid about performance so I like…
user7007
28
votes
11 answers

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 #include int main() { clock_t launch = clock(); …
NicholasFolk
  • 389
  • 1
  • 3
  • 4
26
votes
1 answer

Efficiency of C# dictionaries

C# dictionaries are a simple way to find if something exists etc etc. I have a question though on how they work. Let's say instead of a dictionary I use an ArrayList. Instead of using ContainsKey (or an equivalent method in another language) I loop…
John Demetriou
  • 672
  • 1
  • 10
  • 18
21
votes
5 answers

How to slow down your computer (for testing purposes)?

As most people agree, encouraging developers to make fast code by giving them slow machines is not a good idea. But there's a point in that question. My dev machine is fast, and so I occasionally write code that's disturbingly inefficient, but…
Joonas Pulakka
  • 23,534
  • 9
  • 64
  • 93
20
votes
7 answers

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 matter? I get that it is easier to edit, read and…
fatsokol
  • 309
  • 2
  • 4
1
2 3
11 12