performance

Faster integer division when denominator is known?

hi I am working on GPU device which has very high division integer latency, several hundred cycles. I am looking to optimize divisions. All divisions by denominator which is in a set { 1,3,6,10 }, however numerator is a runtime positive value, roughly 32000 or less. due to memory constraints, lookup table may not be a good option. Ca...

Vector [] vs copying

What is faster and/or generally better? vector<myType> myVec; int i; myType current; for( i = 0; i < 1000000; i ++ ) { current = myVec[ i ]; doSomethingWith( current ); doAlotMoreWith( current ); messAroundWith( current ); checkSomeValuesOf( current ); } or vector<myType> myVec; int i; for( i = 0; i < 1000000; i ++ ) { doSome...

Actual table Vs. Div table

This <table> <tr> <td>Hello</td> <td>World</td> </tr> </table> Can be done with this: <div> <div style="display: table-row;"> <div style="display: table-cell;">Hello</div> <div style="display: table-cell;">World</div> </div> </div> Now, is there any difference between these two in ter...

ASP.NET Performance, 100 "Memory Hard Faults" indiciate a memory swapping problem?

With a customer web site we currently experiences performance problems. While analyzing the problem we found an unexpected amount of of 112 "Memory Hard Faults" per minute. Does anybody can interpret the meaning of this value? Does this happen, when memory swapping is necessary - so the root cause is not sufficient memory? Even if the...

(Why) does Tomcat/Java perform better on Linux than on Windows?

I just read this (one) study in which Tomcat under Linux outperformed Windows. From your experience, is this generally true? Any deep reason that could explain the performance difference? ...

Is there a better way to count the messages in an Message Queue (MSMQ)?

I'm currently doing it like this: MessageQueue queue = new MessageQueue(".\Private$\myqueue"); MessageEnumerator messageEnumerator = queue.GetMessageEnumerator2(); int i = 0; while (messageEnumerator.MoveNext()) { i++; } return i; But for obvious reasons, it just feels wrong - I shouldn't have to iterate through every message just...

Performance Tricks for C# Logging

I am looking into C# logging and I do not want my log messages to spend any time processing if the message is below the logging threshold. The best I can see log4net does is a threshold check AFTER evaluating the log parameters. Example: _logger.Debug( "My complicated log message " + thisFunctionTakesALongTime() + " will take a long t...

which one run faster in mysql

which one run faster in mysql: a query with multiple joins or that query with using nested select? ...

jQuery selector performance

I have the following two code blocks. Code block 1 var checkboxes = $("div.c1 > input:checkbox.c2", "#main"); var totalCheckboxes = checkboxes.length; var checkedCheckboxes = checkboxes.filter(":checked").length; Code block 2 var totalCheckBoxes = $("div.c1 > input:checkbox.c2", "#main").length; var checkedCheckBoxes = $("div.c1 > i...

What is the fastest way to compare 2 rows in SQL?

I have 2 different databases. Upon changing something in the big one (i don't have access to), i get some rows imported in my databases in a similar HUGE table. I have a job checking for records in this table, and if any, execute a stored procedure, process and delete from table. Performance. (Huge amount of data) I would like to know ...

Is there another option to configure the height of an table view cell?

I need a way to alter the UITableView row height differently, but without implementing the delegate method -tableView:heightForRowAtIndexPath: because it causes me some serious performance problems in an indexed table with 15.000 rows. Now the thing is, that every third table is 10 units bigger. than the others. These are a different ki...

UISearchDisplayController and search performance with lots of data

Hello, I'm trying to figure out the best way to perform a fast search using an UISearchDisplayController. I have a plist file with more than 36000 entries. I load this file in a dictionary and I perform the search in this dictionary. It works but it's kinda slow and there is lag between each touch event. I want an autocompletion effect...

in java, which is better - three arrays of booleans or 1 array of bytes?

I know the question sounds silly, but consider this: I have an array of ints (1..N) and a labelling algorithm. at any point the item the int represents is in one of three states. The current version holds these states in a byte array, where 0, 1 and 2 represent the three states. alternatively, I could have three arrays of boolean - one f...

SQL Server: how can I know my stored procedure is optimum in performance

Hi all, I would like to know how to measure/know that one's stored procedure is optimum in performance. That stored procedure can be inserting/deleting/updating or manipulating data in that procedure. Please describe the way/approach how to know performance in SQL Server. Thanks in advance! ...

How to cache asp.net web site for better performance

I am a web designer and usually design corporate web sites which often does not require update. So I want to cache the output for one day. How can I do this? Also any suggestions for better performance for asp.net on slow servers are accepted. ...

Performance problem with System.Net.Mail

I have this unusual problem with mailing from my app. At first it wasn't working (getting unable to relay error crap) anyways I added the proper authentication and it works. My problem now is, if I try to send around 300 emails (each with a 500k attachment) the app starts hanging around 95% thru the process. Here is some of my code whic...

Divide and conquer method to compute roots [SOLVED]

Hello, Knowing that we can use Divide-and-Conquer algorithm to compute large exponents, for exemple 2 exp 100 = 2 exp(50) * 2 exp(50), which is quite more efficient, is this method efficient using roots ? For exemple 2 exp (1/100) = (2 exp(1/50)) exp(1/50) ? In other words, I'm wondering if (n exp(1/x)) is more efficient to (n exp(1/y)...

Performance Impact of Application Packaging in WebLogic 8.1 SP6- EAR vs WAR

We have run into a strange situation. We recently moved all components of an EAR into a WAR - without changing underlying Weblogic version (8.1 SP6). Immediately after the repackaging, we observed significantly higher CPU utilization on the servers. We have run several tests and based on results so far, our current theory is that differ...

Ruby on Rails: Accessing production database data for testing

With Ruby on Rails, is there a way for me to dump my production database into a form that the test part of Rails can access? I'm thinking either a way to turn the production database into fixtures, or else a way to migrate data from the production database into the test database that will not get routinely cleared out by Rails. I'd lik...

SQL Server Multiple Joins Are Taxing The CPU

I have a stored procedure on SQL Server 2005. It is pulling from a Table function, and has two joins. When the query is run using a load test it kills the CPU 100% across all 16 cores! I have determined that removing one of the joins makes the query run fine, but both taxes the CPU. Select SKey From dbo.tfnGetLatest(@ID) a le...