Questions tagged [processing-efficiency]

622 questions
2
votes
2 answers

More Efficient Way to Join Three Tables Together in Postgres

I am attempting to link three tables together in postgres. All three tables are generated from subqueries. The first table is linked to the second table by the variable call_sign as a FULL JOIN (because I want the superset of entries from both…
user3003374
  • 73
  • 1
  • 10
2
votes
1 answer

Python input/output more efficiently

I need to process over 10 million spectroscopic data sets. The data is structured like this: there are around 1000 .fits (.fits is some data storage format) files, each file contains around 600-1000 spectra in which there are around 4500 elements in…
Huanian Zhang
  • 830
  • 3
  • 16
  • 37
2
votes
2 answers

How to efficiently compare large lists in Python?

I am trying to find 9 letter words, that when you split evenly into 3 parts, and jumble around, you get another nine letter word. for i in nineWordList: for j in nineWordList: if (i[3:5] + i[0:2] + i[6:8]) == j: …
Melkor
  • 779
  • 1
  • 12
  • 29
2
votes
1 answer

Efficiency of uniqueness validation in Active Record Rails

Which is more efficient while creating records with unique values for a column in rails Placing uniqueness validation vs finding if record exists with same value and create based on the existence. Which is more efficient in terms of coding and…
2
votes
2 answers

efficient switch statement when using enums

I have an enum and a switch statement using some of the enum entries but not all and they are currently out of order too, i.e. I have the following: enum prot_tun_stat_e { STAT_A = 0, STAT_B, STAT_C, STAT_D, …
stdcerr
  • 13,725
  • 25
  • 71
  • 128
2
votes
2 answers

Efficient binary sampling from vector of probability distribution vectors in MatLab

I'm tidying up some digit classification code. So I feed in an image of a digit, say "7" and I get out 10 probabilities (i.e. sums to 1). If my algorithm is working well, the 7th element should have the highest value. An added complication is that…
P i
  • 29,020
  • 36
  • 159
  • 267
2
votes
2 answers

How to make text search and similarity computation across millions of records efficient in python

I have two tables containing 2 million records each. One has the item names and other item description along with other attributes. I have to match each item in table 1 with each description in table 2 to find maximum similarity matches. So…
2
votes
0 answers

MATLAB Code Efficiency to improve run-time

I have a three dimensional cell that holds images (i.e. images = cell(10,4,5)) and each cell block holds images of different sizes. The sizes are not too important in terms of what I’m trying to achieve. I would like to know if there is an efficient…
2
votes
0 answers

ASP.Net List View becomes too slow when we load or update bulk of records. How can we improve its speed or any other alternative?

I'm trying to load and bind records with ListView but i'm facing these two issues It is taking long time to load the records When i save records after update, it gives error Maximum request length exceeded. Below is the first method which calls on…
2
votes
1 answer

Redis interval query

I have data in the form of a tuple (S, T), where S is string and T is integer. Neither S nor T is unique, while their combination is unique. I need to get all tuples where S1 == S2 and |T1 - T2| <= C. Is is possible to do efficiently with Redis?
2
votes
4 answers

Most efficient way to retrieve all element of a Dictionary from a list of keys?

I've a c# Dictionary instance. I've the following code: private Dictionary _containedObjects = ...;//Let's imagine you have ~4000 items in it public IEnumerable GetItemsList(HashSet
J4N
  • 19,480
  • 39
  • 187
  • 340
2
votes
2 answers

WPF: Most efficient way to remove the last item from a bound list?

In a WPF application, I've a list of object. We will add a lot of element inside this list regularly(~1-10 items/seconds). We want to add a "capacity" to this list, in order that when we reach this capacity, we remove the "oldest" item added. This…
J4N
  • 19,480
  • 39
  • 187
  • 340
2
votes
2 answers

Python code freezes up my computer - Project Euler 58

I am trying to learn python by solving problems from Project Euler. I am stuck on problem 58. The problem states thus: Starting with 1 and spiralling anticlockwise in the following way, a square spiral with side length 7 is formed. 37 36 35 34 33 32…
Naren
  • 107
  • 5
2
votes
4 answers

Most time efficient way to remove stop words in Java from an array of strings

How do I remove these stopwords in the most efficient way. The approach below doesn't remove the stopwords. What am I missing? Is there any other way to do this? I want to accomplish this in the most time efficient way in Java. public static…
2
votes
2 answers

MySQL Select efficient first and last row

I want to get two rows from my table in a MySQL databse. these two rows must be the first one and last one after I ordered them. To achieve this i made two querys, these two: SELECT dateBegin, dateTimeBegin FROM worktime ORDER BY dateTimeBegin ASC…
JRsz
  • 2,891
  • 4
  • 28
  • 44