performance

Slow Performance -- ASP .NET ASPNET_WP.EXE and CSC.EXE Running After Clicking Redirect Link

I click on a link from one page that does a redirect to another page (Response.Redirect(page.aspx)). The browser churns for about 30 seconds and the page displays. I'm trying to track down why it takes so long to load the page. The page hosts two other custom controls. I have commented out the lines of code for each and both control...

Java for loop performance question

Hi, considering this example: public static void main(final String[] args) { final List<String> myList = Arrays.asList("A", "B", "C", "D"); final long start = System.currentTimeMillis(); for (int i = 1000000; i > myList.size(); i--) { System.out.println("Hello"); } final long stop = System.currentTimeMillis(...

Most efficient way to count occurrences?

I'm looking to calculate entropy and mutual information a huge number of times in performance-critical code. As an intermediate step, I need to count the number of occurrences of each value. For example: uint[] myArray = [1,1,2,1,4,5,2]; uint[] occurrences = countOccurrences(myArray); // Occurrences == [3, 2, 1, 1] or some permutation...

Loop Reversal in C# Speeds Up app

We are working on a video processing application using EmguCV and recently had to do some pixel level operation. I initially wrote the loops to go across all the pixels in the image as follows: for (int j = 0; j < Img.Width; j++ ) { for (int i = 0; i < Img.Height; i++) { // Pixel operation code } } The time to exec...

Recommended low memory hashmap for implementation for Java

I am currently working on a programming related problem where I am attempted to make a massive hashmap of data. The key for the data is a custom low-memory implementation of a CharSequence that implements hashCode() and equals(...) and the value is am Integer object. There may be millions of entries in this hashtable and I managed to d...

Performance impact of copying php variables

Just wondering about the performance impact of copying very large php variables. For example say $arr is an enormous array. If I do $arr2 = $arr, is this a deep copy or is $arr2 merely a pointer to $arr like it is in Java? Thanks in advance. ...

Measuring a Windows XP Embedded Application's Memory & CPU Requirements

My question says it all really. Are there any tools like perfmon or xperf that will work under the Windows XP Embedded OS, to monitor the resource requirements of a compiled (C++, as it happens) application as it does its job? ...

MySQL: add a field to a large table

i have a table with about 200,000 records. i want to add a field to it: ALTER TABLE `table` ADD `param_21` BOOL NOT NULL COMMENT 'about the field' AFTER `param_20` but it seems a very heavy query and it takes a very long time, even on my Quad amd PC with 4GB of RAM. i am running under windows/xampp and phpMyAdmin. does mysql have a ...

SQL Server Query Performance - Clustered Index Seek

Excuse the long post, but below I have included a full script to generate and populate my test harness. My test harness has the following tables |--------| |-------------| |-----| |--------------| |Column | |ColumnValue | |Row | |RowColumnValue| |--------| |-------------| |-----| |--------------| |ColumnId| |ColumnValueId|...

MySQL: a huge table. can't query, even a simple select!

i have a table with about 200,000 records. it takes a long time to do a simple select query. i am confiused because i am running under a 4 core cpu and 4GB of ram. how should i write my query? or is there anything to do with INDEXING? important note: my table is static (it's data wont change). what's your solutions? PS 1 - my table h...

ANTLR or Regex?

I'm writing a CMS in ASP.NET/C#, and I need to process things like that, every page request: <html> <head> <title>[Title]</title> </head> <body> <form action="[Action]" method="get"> [TextBox Name="Email", Background=Red] [Button Type="Submit"] </form> </body> </html> and replace the [...] of course. My qu...

how to determine->improve performance of Oracle SP's

We have a lot of SP's and many of them take forever to execute. These SP's are pretty long and its a pain to go through the SP to find out which query is taking long. Whats the best way to find out which query is taking the most time? so that we can just concentrate on that query rather than spending time in research. Currently I am ...

How to increase last day count query performance

I have a table Products with products and table Sales with all sale operations that was done on these products. These tables are connected by Sales.PRODUCT_ID column. I would like to get 10 most often sold products today and what I did is this: SELECT product.* , COUNT( sale.ID ) SUMSELL FROM Products product LEFT JOIN Sales sale ...

How to speed up my sparse matrix solver?

I'm writing a sparse matrix solver using the Gauss-Seidel method. By profiling, I've determined that about half of my program's time is spent inside the solver. The performance-critical part is as follows: size_t ic = d_ny + 1, iw = d_ny, ie = d_ny + 2, is = 1, in = 2 * d_ny + 1; for (size_t y = 1; y < d_ny - 1; ++y) { for (size_t x...

Why is my query so slow? (SQL Server 2008 full text search weirdness)

I have a table with a full-text indexed column MiddlePart. The table has around 600,000 rows. The following query is very fast (30 results, <1 second): select * from DomainName where contains (MiddlePart, '"antiques*"') OR freetext(MiddlePart, 'antiques') This query is also very fast (5 results, <1 second): select * from DomainNa...

Managing cross database reading, views or permissions in MySql

I will have multiple tables used by different projects on the same mySql server. Much of the data is sensitive, and needs to be behind permissions wall. However many of the tables of sensitive data rely on tables of insensitive data for user and department information. So I see three options ahead of me and I am unsure which one to pi...

iPhone SDK Core Data or a 2D Array

I have a data set that is around 700 rows with eight columns of string data. Is it worth setting up core data? Will I see a huge performance difference if between Core Data and an array? The app is a simple UITableView and and a couple of drill down style detail views. I will be searching the data set on one of detail views. ...

Does .Net have a different environment for client and server?

Recently I have heard the bellow statement. Can someone please elaborate on it? With client side applications, Java has better performance than .Net. The reason is that .Net environment on the server-side (iis?) is different than its client side. While Java uses the same environment at both ends. Since frameworks performance is optim...

java compiler optimization

Hi, Is the java compiler smart enough to optimize loop below (by extracting the Double average = new Double( totalTime / callCount ); out of the for loop? public double computeSD( Set values, int callCount, long totalTime ) { double diffs = 0.0d; for( Iterator i=values.iterator(); i.hasNext(); ) { double value = ( ( Double...

Optimizations employed by ORM's

I'm teaching JEE, especially JPA, Spring and Spring MVC. As I have not so much experience in large projects, it is difficult to know what to present to students about optimisation of ORM. At the present time, I present some classic optimisation tricks: prepared statements (most of ORM implicitely use them by default) first and second-...