This is just a personal project I've been digging into. Basically, I parse a text file (say from 20mb up to about 1gb) using StreamReader. The performance is pretty solid, but still... I've been itching to see what would happen if I parse it in binary. Don't misunderstand, I'm not prematurely optimizing. I am defintely micro-optimizing o...
For methods where ...
there exists a static one-to-one mapping between the input and the output, and
the cost of creating the output object is relatively high, and
the method is called repeatedly with the same input
... there is a need for caching result values.
In my code the following result value caching pattern is repeated a lot...
I was reading a blog post by a game coder for Introversion and he is busily trying to squeeze every CPU tick he can out of the code. One trick he mentions off-hand is to
"re-order the member variables of a
class into most used and least used."
I'm not familiar with C++, nor with how it compiles, but I was wondering if
This sta...
So I've been sharing some thoughts on the above topic title on my website about fast, unsafe pixel access. A gentlemen gave me a rough example of how he'd do it in C++, but that doesn't help me in C# unless I can interop it, and the interop is fast as well. I had found a class in the internet that was written using MSDN help, to unsafely...
Hi,
I’ve been experiencing a performance problem with deleting blobs in derby, and was wondering if anyone could offer any advice.
This is primarily with 10.4.2.0 under windows and solaris, although I’ve also tested with the new 10.5.1.1 release candidate (as it has many lob changes), but this makes no significant difference.
The prob...
Is there a way to monitor the CPU and memory usage of Silverlight 2.0 Applications? Are there any tools available for doing this?
...
I'm doing performance tuning for our Tomcat cluster running on SPARC hardware. The 32-bit JVM gives us sufficient memory for now, but we are going to start using Terracotta for server striping so the extra memory the 64-bit JVM offers could be needed soon.
In addition to a bigger memory footprint, moving to the 64-bit JVM on SPARC resul...
Single-threaded version description:
Program gathers a list of questions.
For each question, get model answers, and run each one through a scoring module.
Scoring module makes a number of (read-only) database queries.
Serial processing, single database connection.
I decided to multi-thread the above described program by splittin...
I'm using VB.NET to process a long fixed-length record. The simplest option seems to be loading the whole record into a string and using Substring to access the fields by position and length. But it seems like there will be some redundant processing within the Substring method that happens on every single invocation. That led me to wonde...
I would like to understand good code optimization methods and methodology.
How do I keep from doing premature optimization if I am thinking about performance already.
How do I find the bottlenecks in my code?
How do I make sure that over time my program does not become any slower?
What are some common performance errors to avoid (e.g.;...
I'm working with Java project that requires very advanced manipulations of images. In fact, I'm doing most of the manipulation using OpenCV, and I'm using JNI to wrap around the OpenCV functions that I need. I am extremely satisfied with the performance OpenCV gives, the people who wrote the OpenCV code deserve great great credit for the...
Has anyone used apc_define_constants or hidef vs using define. Any true benefits or possible bugs in the latest versions?
apc-define-constants - http://us2.php.net/manual/en/function.apc-define-constants.php
hidef - http://pecl.php.net/package/hidef
...
Hi, I'm trying to load a java .class file dynamically and call it by reflection.
I've got a class called Foo; it has an empty constructor and has one method called doit() which takes a String argument and returns a String. Also it reverses the String.
Here is my code:
URL url = new URL("file://C:/jtest/");
URLClassLoader loader = ne...
Q1. What are best practices for a writing a code that does not consume CPU but still achieve a great performance? The question is very generic. What I seek over here is to list down different practices used for different environments? debugging tips besides process-monitor/task manager
EDIT:
I am not speaking of IO bound processes. I am...
I have a DataContract class that I have to fill by values from the Active Directory of our company.
[DataContract(Namespace = Global.Namespace)]
public class UserProfile
{
[DataMember(IsRequired = true, EmitDefaultValue = false)]
public string EmployeeID { get; private set; }
[DataMember(IsRequired = true, EmitDefaultValue ...
Hi,
Assuming the following scenario:
class Project{
public Job Job;
}
class Job{
public Name;
}
Assuming I want to use the Criteria API to search for all projects whose Job has the name "sumthing".
I could use the CreateAlias to create an alias for Job and use it to access Name, or I could create a new Criteria for the proper...
Sometimes I see and have used the following variation for a fast divide in C++ with floating point numbers.
// orig loop
double y = 44100.0;
for(int i=0; i<10000; ++i) {
double z = x / y;
}
// alternative
double y = 44100;
double y_div = 1.0 / y;
for(int i=0; i<10000; ++i) {
double z = x * y_div;
}
But someone hinted recently that t...
My app is doing some pretty but heavy weight core animations during scrolling. Sometimes it crashes due to bad performance. So I need some way to find out if there is enough capability to make the animations, and if not, I just leave them away. Best way would be if I could ask the system how busy it is.
UPDATE: I mean especially Core An...
I was told that there is an increase in performance when using Canvas versus HBox or VBox when laying out out the position of children. As a result, a number of our components have been converted over to using Canvas. However, now there is code being added to calculate the x and y positioning of some of the child elements based off of th...
Rails has a nice set of filters (before_validation, before_create, after_save, etc) as well as support for observers, but I'm faced with a situation in which relying on a filter or observer is far too computationally expensive. I need an alternative.
The problem: I'm logging web server hits to a large number of pages. What I need is a...