The efficiency tag has no wiki summary.
7
votes
4answers
1k views
Is try-finally expensive
In case of code where you have to do a resource cleanup before exiting a function, is there a major performance difference between these 2 ways of doing it.
Cleaning the resource before every return ...
2
votes
2answers
143 views
When is a code considered tight and how does it increase efficiency of the code?
I have read many times that insertion sort has tight code and hence the hidden constant factor in its asymptotic complexity is smaller. I just read yesterday that quick sort has tight code just like ...
5
votes
4answers
278 views
How do you keep track of what stage you are at in a program? [closed]
Like many, I'm developing a couple of applications on my own (not at the same time) to eventually sell. But I also have websites to run, college work and a social life etc., so often I can forgot what ...
17
votes
7answers
1k 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
1answer
111 views
Processing every leaf under a node in a tree efficiently
Short version:
In a tree (non-binary) with many levels of children, where each node can have multiple leaves, what is the best way to tally leaves that meet a certain condition given a node?
Long, ...
6
votes
6answers
669 views
Why is binary search,which needs sorted data, considered better than linear search?
I have always heard that linear search is a naive approach and binary search is better than it in performance due to better asymptotic complexity. But I never understood why is it better than linear ...
1
vote
1answer
192 views
Can web apps allow fast data-typists to “type-ahead”?
In some data entry contexts, I've seen data typists, type really fast and know so well the app they use, and have a mechanic quality in their work so that they can "type ahead", ie continue typing and ...
33
votes
9answers
2k views
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 & ...
12
votes
3answers
526 views
Do teams get more productive by adding more developers? [duplicate]
Suppose you've got a project that is running late. Is there any proof or argument that teams become much more productive by adding more people? I am looking for answers that can be supported by facts ...
1
vote
7answers
363 views
Cold, neutral attitude to programming languages - sign of a pro developer or not [closed]
A profesional developer Zed Shaw says this:
Which programming language you learn and use doesn't matter. Do not
get sucked into the religion surrounding programming languages as that
will only ...
-1
votes
4answers
136 views
Give advice from experienced to beginner programmer on reinventing my wheel(solution) [duplicate]
i ve just tried to do coding bat exercise. There are posted solutions to the problem i tried to solve.
However, I was stubborn, i ignored them and tried to code it up my own way(basically reinventing ...
8
votes
4answers
510 views
regular, average programmer - scared of geeks and their skills [closed]
Just like in any other field, 90% of workers do trivial routine things and only less than 10% actually do the most difficult things.
Most programmers in the industry are average, and so am I.
There ...
0
votes
1answer
66 views
Efficient way to find highest value from predicates
I have predicate, that enumerates through backtracking list of values. I want to find highest value from this list.
For example:
ranked_move(X,Y,R) :- between(0,10,Y), between(0,10,X), ...
1
vote
2answers
414 views
Is there a device still being sold that requires efficient programming? What is it? [closed]
Edit: As a lot of you have pointed out, efficient can mean a lot of things. I guess when I say that the device 'requires efficient programming', I mean that the device does not have lots of memory or ...
4
votes
5answers
327 views
What is a good measure of testing/tester efficiency?
I am about to participate in a discussion with management regarding measuring our testing efficiency as a QA organization. The main reason behind this is that half of our team is contracted out and ...
7
votes
5answers
245 views
Programming principles with regard to software (computational) efficiency and the use of variables
I'm classically trained psychologist, not a programmer, so sometimes the more advanced aspects of programming escape me, in particular regarding program efficiency and/or certain best practices, in ...
2
votes
1answer
220 views
How to communicate inefficiency before it's implemented?
This is a problem I come across pretty often. Basically we are using an application to make art content. Often times this requires writing custom tools for it.
Sometimes you run into parts of the ...
0
votes
1answer
392 views
Retrieving hierarchy of tree-nodes stored in relational database
I have a hierarchical ADT that I want to store in a database.
Nodes have exactly one parent element that is a node as well. Multiple nodes can have the same parent node.
My current approach uses an ...
3
votes
1answer
154 views
Aggregate Root and Lots of Data Efficiency
It's more of a scenario, but it isn't far fetched at all. Let's say I have an Aggregate Root (AR) Warehouse which it's used to manage product stock. The Product itself is an AR in a different bounded ...
1
vote
2answers
335 views
Java Alphabetize Algorithm Insertion sort vs Bubble Sort
I am supposed to "Develop a program that alphabetizes three strings. The program should allow the user to enter the three strings, and then display the strings in alphabetical order." It's instructed ...
2
votes
1answer
245 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 ...
6
votes
2answers
190 views
What is an efficient algorithm for randomly assigning a pool of objects to a parent using specific rules
I need some expert answers to help me determine the most efficient algorithm in this scenario.
Consider the following data structures:
type B { A parent; }
type A {
set<B> children;
...
14
votes
5answers
997 views
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 ...
1
vote
4answers
306 views
When should code favour optimization over readability and ease-of-use?
I am in the process of designing a small library, where one of my design goals is that the API should be as close to the domain language as possible. While working on the design, I've noticed that ...
3
votes
3answers
581 views
Combining multiple events into one action/ Defer refreshing
So in a GUI program I have multiple events that trigger a update of a workspace. This update call is costly so I would want it to not happen very often.
A user might pick something from a dropdown ( ...
10
votes
5answers
666 views
Is it ever too early to learn a new language? [closed]
Personal context: I've been learning C++ formally the last 6 months at university. Prior to this I dabbled in JavaScript for a year. Now I am considering learning Python during a month off school.
By ...
3
votes
2answers
837 views
Amortized Analysis? (Worst-case Performance Guarantees)
What is Amortized Analysis? And how can it help me achieve worst-case performance guarantees in my programs?
I was reading that the following techniques can help the programmer achieve Worst-case ...
1
vote
2answers
136 views
Using replacement to get possible outcomes to then search through HUGE amount of data
I have a database table holding 40 million records (table A).
Each record has a string a user can search for.
I also have a table with a list of character replacements (table B) i.e. i = Y, I = 1 ...
3
votes
2answers
1k views
Fast extraction to text file from oracle database
I have to extract around 3 million records from two different databases for further processing. Currently, I execute the queries via SQL*Plus and spool the results to a plain text file.
This queries ...
5
votes
3answers
306 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 ...
2
votes
2answers
884 views
How many make threads to use?
When I (re-)build large systems on a desktop/laptop computer, I tell make to use more than one thread to speed up the compilation speed, like this:
$ make -j$[ $K * $C ]
Where $C is supposed to ...
2
votes
1answer
674 views
Rails application - how to optimize/reduce database calls when iterating over a collection
What's the best way to optimize a Rails app where you need to pull info from the database for a collection of items?
For example, if I am building an online forum system... I would have a number of ...
7
votes
6answers
2k views
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 ...
3
votes
3answers
402 views
Is case after case in a switch efficient?
Just a random question regarding switch case efficiency in case after case; is the following code (assume pseudo code):
function bool isValid(String myString){
switch(myString){
case "stringA":
...
0
votes
2answers
190 views
Using a parser to locate faulty code
Lately I've been working a lot in PHP and have run into an abnormally large number of parsing errors. I realize these are my own fault and a result of sloppy initial coding on my part, but it's ...
0
votes
3answers
261 views
Passing class names or objects?
I have a switch statement
switch ( $id ) {
case 'abc': return 'Animal';
case 'xyz': return 'Human';
//many more
}
I am returning ...
14
votes
6answers
512 views
How do you manage projects left over by other employees? [closed]
It happens that some one just leaves the company all of sudden. Now his work needs to be completed and you are being assigned it. Having no idea what was he up to (was it 90% done or 9%), how do you ...
5
votes
5answers
235 views
Alternatives for comparing data from different databases
I have two huge tables on separate databases. One of them has the information of all the SMS that passed through the company's servers while the other one has the information of the actual billing of ...
3
votes
5answers
1k views
How to test a program in an efficient way?
I know that a writing test case is one of the way to do some programming level testing, but how to test some careless mistake? or how to reduce? For example, a buttonA, should perform ActionA, but ...
4
votes
3answers
1k views
URL Encryption vs. Encoding
At the moment non/semi sensitive information is sent from one page to another via GET on our web application. Such as user ID or page number requested etc. Sometimes slightly more sensitive ...
2
votes
3answers
378 views
Designing a large database with multiple sources
I have been tasked with redesigning, or at worst optimising the structure of a database for a data warehouse.
Currently, the database has 4 other source databases (which is due to expand to X ...
2
votes
1answer
276 views
What are some best practices for minimizing code?
While maintaining the sites our development team has created, we have come across include files and plugins that have proven to be very useful to more then one part of our applications. Most of these ...
5
votes
3answers
206 views
Computed Values and Simple Reads - A nagging pain for my Domain Driven Designs!
The problem I continually face is how to deal with computed values driven by domain logic while still working efficiently against the data store.
Example:
I'm returning a list of Products from my ...
2
votes
2answers
537 views
Efficient Java Programmer [closed]
There's been a buzz in my local tech community about being an 'Efficient Java Programmer' can someone explain to me what is an Efficient Java Programmer? what is their difference between average java ...
3
votes
6answers
531 views
Best way to get programmers to ask for help when they get stuck
What is the best way to ensure that programmers ask for help when they get stuck on a problem, rather than spending too much time trying to figure something out when they've hit a wall?
I'm ...
4
votes
7answers
1k views
Efficient coding in Visual Studio (or another IDE), with touch typing
Moving the cursor to another position in code is one of the most frequent actions when coding. I don't write my programs from the beginning to the end, like a letter. However, moving the cursor ...
4
votes
2answers
312 views
How to measure time lost due to environment problems?
I'm trying to determine how we can measure how much time the developers are loosing to poorly managed environment and inefficient ways-of-working.
The goals are:
Show managment how big the problem ...
0
votes
5answers
539 views
Should speed reading be applied while reading Tech Books [duplicate]
Possible Duplicate:
How do people read big technical books?
It's a known fact that, Science and Tech readings requires most attention, to at least make sense of what one reads. In the age ...
7
votes
4answers
2k views
Is it a good idea to use something like the Twitter Bootstrap in production?
I'm interning at a new startup, and I've been tasked with designing the front-end of the site.
I really, really want to use the new Twitter Bootstrap (http://twitter.github.com/bootstrap/). It's all ...
3
votes
7answers
2k views
What is the best way to INSERT a large dataset into a MySQL database (or any database in general)
As part of a PHP project, I have to insert a row into a MySQL database. I'm obviously used to doing this, but this required inserting into 90 columns in one query. The resulting query looks horrible ...