performance

setting max frames per second in openGL

Is there any way to calculate how much updates should be made to reach desired frame rate, NOT system specific? I found that for windows, but I would like to know if something like this exists in openGL itself. It should be some sort of timer. Or how else can I prevent FPS to drop or raise dramatically? For this time I'm testing it on ...

Performance of new operator versus newInstance() in Java

I was using newInstance() in a sort-of performance-critical area of my code. The method signature is: <T extends SomethingElse> T create(Class<T> clasz) I pass Something.class as argument, I get an instance of SomethingElse, created with newInstance(). Today I got back to clear this performance TODO from the list, so I ran a couple of...

what is the recommended system requirement for using eclipse and maven plugin?

I am wondering what is the recommended system requirement for using eclipse and m2eclipse plugin. I am using E8400 and 4Gb ram currently. Nearly every time I changed something in the pom.xml the eclipse IDE would hang for a while (about 1-3 minutes) before it finished. Is it normal? ...

How to decrease MySQL connection time

I have a JSP page. It used to work well but it becomes very slow (15 seconds to load) after the Systems team upgraded the Solaris 10 OS server. I checked all the queries in that page and every query works fine. In fact they are all very simple queries. And there are only about 300 entries in each related table. The only special thing,...

When should I slurp a file, and when should I read it by-line?

Imagine that I have a C# application that edits text files. The technique employed for each file can be either: 1) Read the file at once in to a string, make the changes, and write the string over the existing file: string fileContents = File.ReadAllText(fileName); // make changes to fileContents here... using (StreamWriter writer = ...

Three-way conditional in c++ to determine sign equivalance of two numbers

I need the most efficient way (in cpu cycles) to determine if two numbers have the same/different sign. But the catch is if either number is zero I need to be able to distinguish it from numbers with same/different signs (ie. zero is treated as a "third" sign). The following code is similar to what I need, but the return values can be an...

jQuery/Javascript "for" function performance improvement

I have a "for" function performed in a jQuery draggable function. Is there a better way to do this from the execution time perspective? My function is: $("#dragger").draggable({ containment: '#timeline', axis: 'x', drag: function(event, ui) { var divs = $("#timeline div.timeline"); ...

Does enabling JMX agent have a performance overhead?

I would like to have a possibility to use jconsole in production, but am a bit concerned about performance. Is it ok to leave JMX agent running (via -Dcom.sun.management.jmxremote) or will it have a noticeable performance footprint? ...

Combining JavaScripts files

I'm using a blogger platform for blogging. I've many widgets on my blog which refer to JavaScript files on the different servers, which is affecting loading performance of my blog. Can I combine those files into one in order to reduce my requests to those servers? Or is there any other way to optimize my JavaScript code? ...

Performance Issues with ActiveRecord / NHibernate and SQL CE

Hello, Our team is currently working on a WPF Desktop application with ActiveRecord and SQLCE 3.5 for backend. We've been experiencing some strange performance issues when executing queries or creating/updating records. In some cases opening a form which has a few grids and data elements that need to be populated, can take around 2 seco...

fastest way to find string in C# ?

What is the fastest way to implement something like this in C#: private List<string> _myMatches = new List<string>(){"one","two","three"}; private bool Exists(string foo) { return _myMatches.Contains(foo); } note, this is just a example. i just need to perform low level filtering on some values that originate as strings. I...

Improve fetch time and this function's performance

I am searching the Final model (defined below) with a query which filters on its name property. This query is taking about 2200ms to execute on the development server. How can I speed it up? Here is an AppStats screenshot. I was filtering on the created field too, but this was taking in excess of 10000ms so I've removed that part of ...

Javascript string performance comparison

I am working on a jQuery/Javascript app where performance is really important. What would be the fastest way in getting a number value from the following code? Is the same execution time for each cases or does it matter? //Case 1 var number = $("#someID").css("left").slice(0, -2)/100; // Returns a number //Case 2 var number= new Strin...

How do you calculate log base 2 in Java for integers?

I use following function to calculate log base 2 for integers: public static int log2(int n){ if(n <= 0) throw new IllegalArgumentException(); return 31 - Integer.numberOfLeadingZeros(n); } Does it has optimal performance? Does someone know ready J2SE API function for that purpose? UPD1 Surprisingly for me, float point arith...

How do 32-bit applications make system calls on 64-bit Linux?

Some (many? all?) 64-bit1 Linux distros allow running 32-bit applications by shipping parallel collections of 32-bit and 64-bit libraries (including libc). So a 32-bit application can link against 32-bit libs and be run by a 64-bit kernel. I'd like to know the mechanics of how 32-bit applications make system calls on a 64-bit kernel. I ...

WPF: what's the most efficient/fast way of adding items to a ListView ?

I need to display lots of rows in a grid added at a pretty high frequency (up to 10 rows per second in some cases) I chose ListView because I assume is the fastest grid control in WPF. (certainly a lot faster than GridView) CPU utilization gets pretty high after couple hundred thousand items were added and they continue to come in. This...

test Wpf Control performance

Specifically for data binding and templates, is there a good way to test the performance of my controls in these respects. I would like to know how much time applying the template and initializing the data binding takes. I am using both Wpf Performance Suite and ANTS Profiler but neither seems to provide information on these aspects. ...

How can I discover my end user's users' system performance settings?

How can I discover my end users' system performance settings (visual effects, etc.)? I want to make my WPF application compatible with those settings. Is there any standard routine to do this or do I just have to read sysinfo? ...

Drawing In Wpf Aplication

I Want Draw 1 000 000 line In Wpf Application But When I Draw To MeshGeometry3D It Is Slow How Increse Speed On Draing 1 000 000 Lines 1 000 000 iS Number Of Line ...

Optimize lots of queries

I have a list of upwards 3,000 decimal values and for each one I need to lookup another decimal value from a SQL Server database. Currently I'm using the .Net SqlClient classes. Making 3,000 queries seems inefficient, but I'm not sure if there's a neat efficient way of combining the queries into few calls. The lookup table currently con...