I am doing profiling of my Java application and found some interesting statistics for a jdbc PreparedStatement call:
Given below is the environment details:
Database: Sybase SQL Anywhere 10.0.1
Driver: com.sybase.jdbc3.jdbc.SybDriver
connection pool: c3p0
JRE: 1.6.0_05
The code in question is given below:
try {
ps = conn.prepareSt...
In .NET what is the best way to find the length of an integer in characters if it was represented as a string?
e.g.
1 = 1 character
10 = 2 characters
99 = 2 characters
100 = 3 characters
1000 = 4 characters
The obvious answer is to convert the int to a string and get its length but I want the best performance possible without the ove...
I am writing an audio player for OSX. One view is a custom view that displays a waveform. The waveform is stored as a instance variable of type NSImage with an NSBitmapImageRep. The view also displays a progress indicator (a thick red line). Therefore, it is updated/redrawn every 30 milliseconds.
Since it takes a rather long time to rec...
In our project to generate massive reports in oracle we use some permanent table to hold intermediate results. For example to generate one report we run few queries and populate the table, at the final step we join the intermediate table with huge application tables.
These intermediate tables are cleared for next report run. We have few...
Hi,
I read tutorials from the web about C# Attributes and Metadata. It's very cool but I'm wondering its implication.
Are (custom) attributes loaded when the assembly is loaded? or is it only when you use reflection to retrieve the metadata?
It seems the attributes add to the total of code size because it gets compiled in to the execut...
When dealing with a collection of key/value pairs is there any difference between using its Add() method and directly assigning it?
For example, a HtmlGenericControl will have an Attributes Collection:
var anchor = new HtmlGenericControl("a");
// These both work:
anchor.Attributes.Add("class", "xyz");
anchor.Attributes["class"] = "xyz...
Does anyone knows if removing the field names from an INSERT query results in some performance improvements?
I mean is this:
INSERT INTO table1 VALUES (value1, value2, ...)
faster for DB to be accomplished rather than doing this:
INSERT INTO table1 (field1, field2, ...) VALUES (value1, value2, ...)
?
I know it might be probably a...
Hi,
I was wondering what the best way is to retrieve a certain field of all documents returned by a Searcher of Lucene.
Background: each document has a date field (written on) and I would like to show a timeline of all found documents, so I need to extract the date (day) field of all the documents I find with the search.
I currently r...
At my work we're discussing different approaches to cleaning up a large amount of managed ~50-100MB memory.There are two approaches on the table (read: two senior devs can't agree) and not having the experience the rest of the team is unsure of what approach is more desirable, performance or maintainability.
The data being collected is ...
I am learning WPF and it seems like some properties like Content are of type Object. When you have a very complex UI with 1000s of controls, would this be a problem with boxing, etc?
I see that this provides a lot of power (having Content to take anything), but just thought I should ask people's opinions about this.
...
Hi, I am planning to participate in development of a code written in C language for Monte Carlo analysis of complex problems. This codes allocates huge data arrays in memory to speed up its performance, therefore the author of the code has chosen C instead of C++ claiming that one can make faster and more reliable (concerning memory leak...
We have a RIA application that 300 clients concurrently use in an intranet environment. Together they make 30 calls / second to IIS (asp.net) (actually it's 60 but calls are loadbalanced over two IIS servers). Half of the calls is getting an asset (Caching Profile is used so most of the time cache is hit), the other half is saving data t...
Hi All:
We are using SQLite database to store data. We are having a very peculiar situation. Let me summarize
Database having multiple tables.
Tables having 3000 rows.
Tables are having index.
There is considerable gain due to indexes.
When I run the application and access certain data the query runs slow.
But if I just open the datab...
We have a class that is more like a template (with lot of properties and overridden methods). I need to make many objects of that class type. Can I use clone() to create objects with specific settings if I have one object created? I know I need to override the Clone method. Is the performance going to take a hit by using Clone()?
...
Hi,
I have a method which returns an array of fixed type objects (let's say MyObject).
The method creates a new empty Stack<MyObject>. Then, it does some work and pushes some number of MyObjects to the end of the Stack. Finally, it returns the Stack.ToArray().
It does not change already added items or their properties, nor remove them...
I work on an internal corporate system that has a web front-end as one of its interfaces.
The web front-end is served up using Tomcat.
How can I monitor the rendering time of specific pages in a browser (IE6)?
I would like to be able to record the results in a log file (separate log file or the Tomcat access log).
EDIT: Ideally, I ne...
So if I have a WPF window, would moving another window over the WPF window cause the WPF window to do thousands of redraws like Windows Forms?
I am wondering the effects of using vectors in this case, as opposed to everything being bitmap-based like Window Forms.
...
I pine for the days when, as a C programmer, I could type:
memset( byte_array, '0xFF' );
and get a byte array filled with 'FF' characters. So, I have been looking for a replacement for this:
for (int i=0; i < byteArray.Length; i++)
{
byteArray[i] = 0xFF;
}
Lately, I have been using some of the new C# features and have been us...
We are using MSChart on an ASP.net 3.5 web application and noticing significant slowness from enabling tooltips. the performance of drawing a chart is increased by 1,000-2,000ms.
The chart output is PNG, and contains in total 108 data points.
...
Hello, I am using an open source library to connect to my webserver. I was concerned that the webserver was going extremely slow and then I tried doing a simple test in Ruby and I got these results
Ruby program: 2.11seconds for 10 HTTP
GETs
Ruby program: 18.13seconds for 100 HTTP
GETs
C# library: 20.81seconds for 10 HTT...