Questions tagged [processing-efficiency]
622 questions
7
votes
3 answers
large-scale document co-occurrence analysis
I have about 1000 files. Each of which contains about 20,000 documents. I also have a list of about 1,000,000 words.
I want to calculate how many time each word occurs with any other words. So, there is a sparse matrix of size 1M X 1M.
To speed up…

DotNet
- 697
- 2
- 7
- 23
6
votes
1 answer
Erlang: atoms or integers
I want to pass around a message as such
{up, Distance}
{down, Distance}
I could also do this as such
{1, Distance}
{-1, Distance}
The key difference is one is an atom and other an integer. Reading the man pages…

BAR
- 15,909
- 27
- 97
- 185
6
votes
2 answers
Efficient Stopwatch
Hi I'm programming a stopwatch utility in javascript and I have a question about efficiency and overhead. There are two ways I have considered making the stopwatch:
1.Store a start Date and constantly measure the number of milliseconds it has been…

Drew Galbraith
- 2,216
- 4
- 19
- 22
6
votes
2 answers
Efficient way to get group names in pandas
I have a .csv file with around 300,000 rows. I have set it to group by a particular column, with each group having around 140 members (2138 total groups).
I am trying to generate a numpy array of the group names. I have used a for loop to generate…

swopnil
- 347
- 1
- 3
- 11
6
votes
1 answer
Erlang 'catch' expression vs try/catch in terms of efficiency
A similar question was asked about this but it was not exactly asked in the same terms.
I am trying to safely decode base64 binaries, in a context where it's possible the input will not be a binary, or even base64 encoded.
Erlang says let it crash…

Barry Bant
- 63
- 5
6
votes
1 answer
Is swapping variables by array destructuring efficient?
ES6 supports array destructuring which could be used to swap variables in succinct syntax like below, but is this efficient and suggested in performance sensitive code as array processing? Because it seems a new temporary array is needed to complete…

Thomson
- 20,586
- 28
- 90
- 134
6
votes
2 answers
Efficient code: short vs integer data types in VB.Net
I'm writing an application where performance is fairly critical. I'm a bit confused as to which is the most efficient data type for x64 CPUs.
MDSN says that "In some cases, the common language runtime can pack your Short variables closely together…

Absinthe
- 3,258
- 6
- 31
- 70
6
votes
6 answers
What is more efficient, reading word by word from file or reading a line at a time and splitting the string using C ?
I want to develop an application in C where I need to check word by word from a file on disk. I've been told that reading a line from file and then splitting it into words is more efficient as less file accesses are required. Is it true?

mlemboy
- 387
- 2
- 3
- 15
5
votes
1 answer
Tips for efficient string matching (and indexing) for large data in R?
What I want to do
I have a number of unique ids, e.g. id1, id2, etc.. They appear in a number of groups, and each group is a random sample of between 1 and 100 ids, e.g.
[1] "id872- id103- id746-"
[2] "id830- id582-" …

R Greg Stacey
- 425
- 4
- 15
5
votes
1 answer
Node: one core, many processes
I have looked up online and all I seem to find are answers related to the question of "how does Node benefit from running in a multi core cpu?"
But. If you have a machine with just one core, you can only be running one process at any given time. (I…

Maria Ines Parnisari
- 16,584
- 9
- 85
- 130
5
votes
1 answer
Where can I find the cost of the operations in Spark?
Let's say I have two RDDs with size M1 and M2, distributed equally into p partitions.
I'm interested in knowing that (theoretically / approximately) what is the cost of the operations filter, map, leftOuterJoin, ++, reduceByKey, etc.
Thanks for the…

David Herskovics
- 235
- 1
- 4
5
votes
2 answers
Erlang: Read from an input stream in a efficient way
I'm writing a program that reads from an input stream, i.e.
erl -run p main -noshell -s erlang halt < input
The problem is that it takes a lot of time to read it (the input stream is huge) using this read function:
read_input(L) ->
case…

Salvador Tamarit
- 151
- 8
5
votes
1 answer
Efficient(?) string comparison
What could possibly be the reasons to use -
bool result = String.Compare(fieldStr, "PIN", true).Equals(0);
instead of,
bool result = String.Equals(fieldStr, "PIN", StringComparison.CurrentCultureIgnoreCase);
or, even simpler -
bool result…

atiyar
- 7,762
- 6
- 34
- 75
5
votes
2 answers
Efficiency & speedup of parallel vs. serial
Currently, I am reading over a study a guide that my professor handed out in class. The study guide is not an assignment, just something to know what to expect on an exam. I've completed all but 1 problem and was hoping someone could help me…

Ronnie
- 91
- 1
- 1
- 4
4
votes
2 answers
Ruby on Rails: reverse lookup of array list of values
i have a model with a user selectable option that is set up in an array on the model.
def Pie < ActiveRecored::Base
def self.sel_options
[ [ "Apple Blueberry", "AB" ],
[ "Cranberry Date", "CD" ] ]
end
end
while the short…

jay
- 602
- 5
- 14