performance

iphone memory management

I have a method that returns a NSMutableArray: //implementation of class Students -(NSMutableArray *)listOfStudents { NSMutableArray *students = [[NSMutableArray alloc] init]; //add objects to students and other operations here return students; } The problem here is, when and where do I release the object students? If it was an...

How can I minimize the data in a SQL replication

I want to replicate data from a boat offshore to an onshore site. The connection is some times via a sattelite link and can be slow and have a high latency. Latency in our application is important, the people on-shore should have the data as soon as possible. There is one table being replicated, consisting of an id, datetime and some...

Which is faster? Comparison or assignment?

I'm doing a bit of coding, where I have to write this sort of code: if( array[i]==false ) array[i]=true; I wonder if it should be re-written as array[i]=true; This raises the question: are comparisions faster than assignments? What about differences from language to language? (contrast between java & cpp, eg.) NOTE: I've hear...

How to clear APC cache entries?

I need to clear all APC cache entries when I deploy a new version of the site. APC.php has a button for clearing all opcode caches, but I don't see buttons for clearing all User Entries, or all System Entries, or all Per-Directory Entries. Is it possible to clear all cache entries via the command-line, or some other way? ...

Is there anyway to monitor one single (class) of object in terms of cache?

I am trying to determine which implementation of the data structure would be best for the web application. Basically, I will maintain one set of "State" class for each unique user, and the State will be cached for some time when the user login, and after the non-sliding period, the state is saved to the db. So in order to balance the db ...

Why are sealed types faster?

Duplicate: Why seal a class? I am wondering about the deeper details about why this is true. ...

What is faster (x < 0) or (x == -1)?

Variable x is int with possible values: -1, 0, 1, 2, 3. Which expression will be faster (in CPU ticks): 1. (x < 0) 2. (x == -1) Language: C/C++, but I suppose all other languages will have the same. P.S. I personally think that answer is (x < 0). More widely for gurus: what if x from -1 to 2^30? ...

Overhead of using this on structs

When you have automatic properties, C# compiler asks you to call the this constructor on any constructor you have, to make sure everything is initialized before you access them. If you don't use automatic properties, but simply declare the values, you can avoid using the this constructor. What's the overhead of using this on constructo...

Best Spring/Hibernate configuration for never changing tables

I'm currently using Spring+Hibernate+MySQL for a project I'm working on. I realized that a have quite a few tables which never change. They are static, no insert or updates can ever occur on these tables, and so can be considered immutable. All accesses to these tables are via lazy loading (can be made eager) of entity collections and...

Is there any run-time overhead to readonly?

For some reason, I've always assumed that readonly fields have overhead associated with them, which I thought of as the CLR keeping track of whether or not a readonly field has been initialized or not. The overhead here would be some extra memory usage to keep track of the state and a check when assigning a value. Perhaps I assumed thi...

how jvm handles creating object inside a loop

List list = new ArrayList(); String[] test = {"ram", "mohan", "anil", "mukesh", "mittal"}; for(int i =0; i < test.length; i++) { A a = new A(); a.setName(test[i]); list.add(a); } How JVM handles creation of object a in each loop? How "list" differntiate between different instance? Is it good practice to create object on e...

How to improve dsoframer performance?

Hi, I'm looking for a control that we can use as a text editor in our win and web application. Do you think dsoframer can be a good choice? using dsoFramer ,it takes 3 secs to create a word document .Is it possible to make it faster? ...

Why execution time is longer after the first try? (javaScript performance test)

While doing some JavaScript performance tests I came up with the following piece of code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt; <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Performance Test</title> <script...

what is worse for speed when loading CSS, a second LINK element or @import?

need to add a 2nd css stylesheet to a page. do i add a 2nd link line and load it by url, or add a @import to the original? what is worse for page load times? what is worse for server load? what is better for client side caching? what is better/more accepted 'in general'? (note: assume no cdn or memcache, just a normal regular average...

Convert.ToInt32 versus TryParse

We all know the effects that lots of thrown exceptions can have over the performance of our applications, thus, we should stay away from things like using exceptions for control flow. After this statement I must confess that when coding I didn't care that much about this. I've been working mostly on Java platform but lately I was doing i...

IIS monitoring tool

Hello, I have a need for a tool that would monitor and more importantly log requests on IIS. This tool would have to report basic info about requests such as date/time of request, time spent for request, kbytes transferred... etc What do you people use for such monitoring? ...

LinqToSql - avoiding excessive queries to the database

This scenario comes up often, now that I use LinkToSql and the classes it creates. Classic scenario - two tables: Member ID Name ... Membership ID MemberID (foreign key) Start (datetime) Expiration (datetime) ... An active membership would be one where now is between start and expiration. To find out if a user has an active members...

Is there a way to multithread a SqlDataReader?

I have a Sql Query which returns me over half million rows to process... The process doesn't take really long, but I would like to speed it up a little bit with some multiprocessing. Considering the code below, is it possible to multithread something like that easily? using (SqlDataReader reader = command.ExecuteReader()) { while (r...

How to Speed Up Simple Join

I am no good at SQL. I am looking for a way to speed up a simple join like this: SELECT E.expressionID, A.attributeName, A.attributeValue FROM attributes A JOIN expressions E ON E.attributeId = A.attributeId I am doing this dozens of thousands times and it's taking more and more as the table gets bigger. I ...

Is sqrt still slow in Delphi 2009?

Is sqrt still slow in Delphi 2009? Are the old tricks (lookup table, approx functions) still useful? ...