The tag has no wiki summary.

learn more… | top users | synonyms

3
votes
1answer
44 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 ...
4
votes
1answer
104 views

(jQuery) What is wrong with methods such as .append?

tl;dr: What is wrong with the efficiency of methods such as .append() and what can be alternatives to this? Explanation: Hello everyone. I occasionally have to build A/B tests for websites, which ...
1
vote
2answers
140 views

How does Yahoo's Smush.It work and why doesn't everyone use it?

I've recently come across an application by Yahoo called SmushIt. Apparently it does lossless compression on images. Sometimes the image size is reduced by as much as 90%. This of course has major ...
1
vote
1answer
194 views

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 ...
1
vote
1answer
23 views

Should I do a different SQL table for user privacy settings or just keep it at the users table?

So I am developing a Web Application and I have some concerns about the database. I use a lot of boolean settings at the user table with the form privacy_allow_1, privacy_allow_that, ...
3
votes
1answer
76 views

How do I efficiently send notifications for different events to different users based on their preferences?

I'm creating a notification system for particular events. A user can set the criteria that match particular events (ie. New item, changed item, closed item etc) Items have different characteristics ...
0
votes
3answers
163 views

Using action array vs Switch Case [closed]

I have an occasion of code in which I will draw a different set of buttons in a screen (depending on the number of the buttons). One thought (and my current implementation) is to use an action array ...
0
votes
3answers
151 views

What is more efficient, a single square root or multiple divisions?

Say I make a program that calculates all possible (integral) factors of a certain number that has been input. Is it theoretically more efficient to check with all integers up to the square root of ...
1
vote
2answers
321 views

How to approach program design with respect to data strucutres and algorimths - is there an equivelant of the OO design process for d.s.'s + algs? [closed]

My applogies for probably the worst written body of text I have produced in my life and many thanks to those willing to plough through it all. I was (and still am) not able to clearly express what I ...
0
votes
2answers
112 views

Should you avoid adding unecessary stack frames?

I have been working with laravel (PHP) recently, and there is an option when using their fluent ORM to define where clauses using closures. This gives us two, functionally equivalent, ways to specify ...
26
votes
10answers
4k 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 ...
0
votes
0answers
31 views

Are Components ideal for packaging and reusing find() requests?

I find myself loading several models over and over again throughout my application. Instead of typing the code to load the model, run a find, would it be reasonable to put that code in a method and ...
3
votes
2answers
77 views

Trivially Sortable Encoding for Arbitrary-Precision Decimals

I'm looking for a reasonably(*) space-efficient way to encode arbitrary-precision decimals (e.g. BigDecimal), such that when sorting the bit-pattern of the encodings lexicographically, the numbers ...
1
vote
1answer
33 views

Custom Domain or Attribute Reference Table or Both?

I'm designing my first real database and I'm weighing the pros and cons of how to enforce uniformity in my data. My first option is to create a custom domain and program my UI to only allow certain ...
2
votes
5answers
284 views

Simplicity-efficiency tradeoff

The CTO called to inform me of a new project and in the process told me that my code is weird. He explained that my colleagues find it difficult to understand due to the overly complex, often new ...
1
vote
3answers
202 views

Is there a difference in resource allocation & efficiency between a web app and a compiled one? [closed]

I'm a web developer. I feel like I develop less resource-intensive functionality often times, because I have this feeling that if I ask too much of the web app (animation, calculation, connections, ...
2
votes
2answers
181 views

Most efficient way to store this collection of moduli and remainders?

I have a huge collection of different moduli and associated with each modulus a fairly large list of remainders. I want to store these values so that I can efficiently determine whether an integer is ...
-1
votes
1answer
190 views

How to code efficiently? [duplicate]

I often compare my code to others and I find their solution more efficient and shorter than mine. Although both solutions work, I can't help it but wonder if mine is not adequate enough. As a result, ...
0
votes
1answer
53 views

Replacing string comparisons with dictionary lookups

Given 2 strings s1 and s2, if I do a simple equality check , it is considered to be O(n) when calculating algorithm efficiency. So, if I am using a brute force approach for the rotated substring ...
0
votes
1answer
92 views

How can I approach creating an efficient algorithm for maximizing value with these specific constraints?

I'm having trouble coming up with an approach that isn't n^2 for this problem. Here's a contrived, simplified version I've come up with: Let's say you're a company that needs 4 employees to launch in ...
0
votes
1answer
114 views

How to Learn Doing it Right Way? [closed]

I am self taught web developer. I do not have any computer science degree from university. I know HTML5, CSS3, Javascript, PHP and some Python. But I am having difficulties about being efficient. When ...
0
votes
3answers
337 views

Least Change Problem with Thousands of Denominations

In a hypothetical economy there are currency units that can represent thousands of different values. So, for example there might be coins worth 1c, 3c, 5c, 7c, 7.5c, 80c, 8001.5c etc. Given a list of ...
0
votes
1answer
41 views

lots of images and ajax, or better solution?

I have a control where the user can select a value for the x and y axis from 2 dropdowns, and then there is a 4 by 4 grid (an image) which will show what their selections correspond to (updating ...
0
votes
2answers
341 views

Quick algorithm to find matches between two arrays

I'm faced with the following problem: I have an array which is produced by the parsing of a yaml file which contains patterns in the following structure. "Programming books" Title: a ...
0
votes
1answer
60 views

How to prevent re-checking already-checked data?

I have a class with a validId($id) method that is called by the constructor and by public function load($id). The method queries the database to see if the id exists and returns true/false. The ...
9
votes
5answers
624 views

Can a pure-functional solution to this problem be as clean as the imperative?

I have an exercise in Python as follows: a polynomial is given as a tuple of coefficients such that the powers are determined by the indexes, e.g.: (9,7,5) means 9 + 7*x + 5*x^2 write a function to ...
5
votes
3answers
5k views

Quickest way to split a delimited String in Java

I am building a Comparator that provides multi-column sort capability on a delimited String. I am currently using the split method from String class as my preferred choice for splitting the raw String ...
0
votes
1answer
101 views

Are expensive operations for a user bad for other users?

Let's say user A does something expensive (regarding CPU and/or memory), which takes a few seconds. Concurrently, user B needs a very small amount of computing time. In this case, will the computing ...
1
vote
2answers
198 views

Making an algorithm more efficient

I have a question about the efficiency of an algorithm: You have a list of x,y points Now I want to get all the points that are up to 5 units away from a reference x,y point How do you calculate it ...
0
votes
1answer
112 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 ...
1
vote
3answers
730 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
580 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 ...
6
votes
5answers
417 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 ...
9
votes
5answers
2k 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
346 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
572 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
2k 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 ...
3
votes
1answer
196 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
5k 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
329 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 ...
36
votes
9answers
3k 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
583 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
425 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
153 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 ...
6
votes
4answers
814 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
217 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
441 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
2k 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
270 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
226 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 ...