c ++ passing large vectors in output

I have several big vector (roughly with a million elements), lets say vector<int> v generated in a function or a class member function. I want to use this vector outside of this function/member efficiently, i.e., avoid copying it entirely when I pas

Ruby each vs while loop performance

trying to resolve a basic problem of algorithm in Ruby, and testing performance. Just in case, the algorithm aims to find the smallest positive number that is evenly divisible by all of the numbers from 1 to 20. Here's the code : def remainder(number

How to speed up the subset in groups

I used to achieve my data wrangling with dplyr, but some of the computations are "slow". In particular subset by groups, I read that dplyr is slow when there is a lot of groups and based on this benchmark data.table could be faster so I started

Scalable dot matrix product efficient in Scipy Python

I have a really big (1.5M x 16M) sparse csr scipy matrix A. What i need to compute is the similarity of each pair of rows. I have defined the similarity as this: Assume a and b are two rows of matrix A a = (0, 1, 0, 4) b = (1, 0, 2, 3) Similarity (a,

How will it be more effective? (Android Java programming)

In my app I need to change the value of an integer variable . The way I have changed this , like this int variable; if (condition) { variable= 1; } else if (condition) { variable= 2 ; } .......... .......... else { variable=3; } Or shpould I declare

Do the views degrade the performance of the LINQ query?

I was looking for some tips to improve my entity framework query performance and came accross this useful article. The author of this article mentioned following: 09 Avoid using Views Views degrade the LINQ query performance costly. These are slow in

why is the python XML scanning speed inconsistent?

I am parsing a large (12 GB) XML file made of about 135k more or less similar records (this is an nmap dump). I noticed that the parsing speed is inconsistent, the time to parse similar records changes wildly. The following scaled-down code outputs t

Java creating new performance objects

I have the below class. class MyObject implements Serializable { private String key; private String val; private int num; MyObject(String a, String b, int c) { this.key = a; this.val = b; this.num = c; } } I need to create a list of Objects, the foll

Load HTTP test services

We are developing servers that are based on HTTP RESTful APIs, and would like to loadtest the APIs. Could anyone point us to a loadtest that that can do the following: Can compose load test scripts by typing and not by clicking any GUI buttons (like

read a csv file with a million lines in parallel in C #

I have a CVS file with over 1 Million rows of data. I am planning to read them in parallel to improve efficiency. Can I do something like the following or is there a more efficient method? namespace ParallelData { public partial class ParallelData :

Cursor in Android (SQLite)

I have a problem with the cursor in Android... public int getCountNameContainWord(String word){ long time1=System.currentTimeMillis(); Cursor cur = bdd.query(TABLE_IDF, new String[] {"COUNT(idfs)"}, "idfs LIKE '"+word+"%'", n

improve application performance and intelligence

I have a question which is related to application performance and intelligence. I have created a window service, if I run it on a 3 different configuration machines. I want it to utilize appropriate resources of machine (CPU and memory). Say Machine

Reduced memory loss when processing a large dataset

Java has a tendency to create a large number objects that needs to be garbage collected when processing large data set. This happens fairly frequently when streaming a amounts of data from the database, creating reports, etc. Is there a strategy to r

How to develop a performance benchmarking program

Probably everybody heard about different software used to measure performance of the hardware it is running on. I mean stuff like Windows Experience Rating, PCMark, Futuremark and so on. They are measuring different aspects of computer performance: C

MySQL vs. SQLite on Amazon EC2

I have a Java program and PHP website I plan to run on my Amazon EC2 instance with an EBS volume. The program writes to and reads from a database. The website only reads from the same database. On AWS you pay for the amount of IOPS (I/O requests Per

Is Doctrine really so slow?

I am using a Doctrine in my application but it seems that it really slows down my application. A simple code like this: $q = Doctrine_Query::create() ->select('co.id') ->from('CounterOnline co') ->where('co.user_id = ?', $user_id) ->orWhere('c

Best way to preprocess and find a text file in .NET CF

I have a text file with about 100,000 lines (5 MB), which is updated once a day. It grows at a rate of about 30 lines a day. The lines are not sorted in any way. Each line is 50 hex characters long and looks like this: ABCDE9DAF1F66C10C02F25A1685821F

General webpage loading speed and performance best practices

What are some general (not specific to LAMP, .NET, Ruby, mySql, etc) tactics and best practices to improve page loading speed? I am looking for tips about caching, HTTP headers, external file minification (CSS, JS), etc. And for good tools like Googl

How to optimize this low performance MySQL query?

I'm currently using the following query for jsPerf. In the likely case you don't know jsPerf - there are two tables: pages containing the test cases / revisions, and tests containing the code snippets for the tests inside the test cases. There are cu

How to decrease the perceived load time of Java Swing forms?

In my Swing application I have the problem that when creating a new instance of a Swing form for the first time, it takes several hundreds of milliseconds. That's not really long but the subjective impression of getting slowed down is really annoying

VS 2008 SP1 on Remote Desktop: repainting constantly?

The text editor in Visual Studio 2008 was very fast over Remote Desktop. The text editor in Visual Studio 2008 SP1 is very slow over Remote Desktop, causing way too much repainting (and resulting flickering). The slower your connection is, the worse

Xsd validation against class-level validation generated by xsd

In my project I have very big XSD file which i use to validate some XML request and response to a 3rd party. For the above scenario I can have 2 approaches 1) Create XML and then validate against give XSD 2) Create classes from XSD with the help of X

Something faster than HttpHandlers?

What is the fastest way to execute a method on an ASP.NET website? The scenario is pretty simple: I have a method which should be executed when a web page is hit. Nothing else is happening on the page, the only rendered output is a "done" messag

In .NET, will empty method calls be optimized?

Given an empty method body, will the JIT optimize out the call (I know the C# compiler won't). How would I go about finding out? What tools should I be using and where should I be looking? Since I'm sure it'll be asked, the reason for the empty metho