The efficiency tag has no wiki summary.
0
votes
1answer
88 views
Is creating a separate pool for each individual png image in the same class appropriate?
I'm still possibly a little green about object-pooling, and I want to make sure something like this is a sound design pattern before really embarking upon it. Take the following code (which uses the ...
0
votes
0answers
131 views
Better way for calculating project euler's 2nd problem Fibonacci sequence) [migrated]
object Problem_2 extends App {
def fibLoop():Long =
{
var x = 1L
var y = 2L
var sum = 0L
var swap = 0L
while(x < 4000000)
{
if(x % 2 ==0) sum +=x
swap = x
x = y
y = ...
1
vote
3answers
194 views
Storing a value vs calling reference for repeated use in Java
I have an old habit of avoiding calling references multiple times, both for easier to read/maintain code, and for possible efficiency. But I'm wondering which is more efficient (memory, performance, ...
4
votes
2answers
487 views
How much logic can be put into an object-pooling factory class before it does more harm than good?
The main language I'm interested in doing object pooling in is AS3, which is known to need it in many cases. In the past I've always made a brand new factory class for every type I was going to try ...
5
votes
5answers
375 views
Maintaining good form while learning new technologies
I find that I have to learn new technologies fairly regularly as a contractor in order to keep competitive.
However, I also find that (not only, but especially) in these circumstances, I tend to end ...
8
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
164 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
317 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 ...
18
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
125 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
1k 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
224 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 ...
34
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 & ...
11
votes
3answers
542 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
383 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
139 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
574 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
79 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
420 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
419 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
249 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
222 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
478 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
176 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
votes
2answers
403 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
249 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
195 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;
...
15
votes
5answers
1k 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
308 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
681 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
686 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
967 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 [closed]
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
328 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 ...
3
votes
2answers
1k 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 ...
3
votes
1answer
755 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
3k 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
406 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
195 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
295 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
525 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
261 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 ...
2
votes
4answers
1k views
How to test a program in an efficient way? [closed]
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
415 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
300 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
222 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
565 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
552 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 ...