optimization

Optimizing for ARM: Why different CPUs affects different algorithms differently (and drastically)

I was doing some benchmarks for the performance of code on Windows mobile devices, and noticed that some algorithms were doing significantly better on some hosts, and significantly worse on others. Of course, taking into account the difference in clock speeds. The statistics for reference (all results are generated from the same binary,...

simplified boundary checking for Java List

Is there an easy way/library to check and adjust parameters to stay inside the lists boundaries? Here a long sample: if (fromIndex < 0) { fromIndex = 0; } if (fromIndex > list.size() - 1) { fromIndex = list.size() - 1; } if (toIndex < 0) { toIndex = 0; } if (toIndex > list.size() - 1) { toIndex = list.size() - 1; } list.subLi...

Multiple Join or subquery query optimization SOLVED

I have this query, which executes in 1 or 2 seconds for a given case: Select Count(*) as qtty From event e Join org o On o.orgID = e.orgID Join venue v On v.venueID = e.venueID Where Match( e.name, e.description ) Against ( $keywords ) And e.site_id = $site_id And e.display <> 0</code> I...

Mysql Large Volume of Queries

What is the best way to optimize a MYSQL server that has 400-1000 queries across 20 tables running against it from 20-30 users? I have these reports that run against the server and they need anywhere from 400-1000 queries to get all the necessary information. The two issues I am facing are the queries individually are relatively fast bu...

how to reduce growing size of an access file?

Hi, So, at my workplace, they have a huge access file (used with MS Access 2003 and 2007). The file size is about 1.2GB, so it takes a while to open the file. We cannot delete any of the records, and we have about 100+ tables (each month we create 4 more tables, dont ask!). How do i improve this, i.e. downsizing the file? thanks. ...

Optimizing independent foreach iterations in .NET3.5

Let's say I have foreach(int x in xs[]) // xs is an array of int { x++; } Each time through the foreach is independent of the others. Is there a quick way to instruct the CLR to do each on a seperate thread or speed it up by natively parallelising it? Maybe it already knows to do this. I know you I could create threads and start t...

need help with .htaccess optimizatio, please, site is opening slow and resource hungry

can somebody help me optimize this .htaccess file, it feels like the website takes a bit longer to open then it should, I must be missing some rewritecond'itions ... here's the file contents: AuthUserFile /usr/www/secure/.htpasswd AuthName "Pre Launch Test Area" AuthType Basic RewriteEngine On Options -Indexes RewriteCond %{REQUES...

Controlling compiler options in Eclipse

Is there a way to control the optimization level of the java compiler that Eclipse uses when building a project? Or is this question not relevant anymore, is all optimization deferred to the vm? The reason I'm asking is that I recently wrote a quick test doing this: private static int test_f(int i) { return i * 42; } ... int z = 41; ...

Optimize jQuery hover code to perform better (smoother animation)

Lately I've been spending some time reading about jQuery optimization tips which has certainly helped increase the performance of my scripts. However, I've got this featured news section on my site, which on mouse hover slides more information into place, and this section doesn't perform very well in any browser except Safari (and proba...

Analog of StringBuilder for BigDecimal.

I've got a list of BigDecimals to sum. If they were Strings to concatenate, I would use StringBuilder to reduce object creation. Is there something similar for BigDecimal? Or maybe I shouldn't bother about it? Is optimization of BigDecimal creation worth putting effort to it? BigDecimal result = BigDecimal.ZERO; for (CashReportElement e...

Optimizing a static php website

i am making a "static" php website in this style <?php include "header.php" ?> <?php include "left.php" ?> <?php include "photos.php" ?> In "photos.php" i have 3 heavy javascript files from the lightbox and i thought it could be a good to include the javascript files only in this "photos.php" and not at the "header.php". But javascrip...

Is Performance Always Important?

Since I am a Lone Developer, I have to think about every aspect of the systems I am working on. Lately I've been thinking about performance of my two websites, and ways to improve it. Sites like StackOverflow proclaim, "performance is a feature." However, "premature optimization is the root of all evil," and none of my customers have ...

DateTimeFormatInfo.InvariantInfo vs CultureInfo.InvariantCulture

I am trying to parse DateTime, with an exact format being accepted from client input. Which one is better bool success = DateTime.TryParseExact(value, "dd-MMM-yyyy", DateTimeFormatInfo.InvariantInfo, DateTimeStyles.None, out dateTime); OR bool success = DateTime.TryParseExact(value, "dd-MMM-yyyy", CultureInfo.InvariantCultur...

How do I work out the cost benefit of optimisation?

I want to figure out how much money I'd save if I optimise some part of my web app. If I save 100 cpu milliseconds over 50K calls to the app, how much electricity is that not using in a day? How about over a year? I've tried to find some figures thru google, but my googling mojo is failing me at present. ...

String capitalize - better way

What method of capitalizing is better? mine: char[] charArray = string.toCharArray(); charArray[0] = Character.toUpperCase(charArray[0]); return new String(charArray); or commons lang - StringUtils.capitalize: return new StringBuffer(strLen) .append(Character.toTitleCase(str.charAt(0))) .append(str.substring(...

Replicate part of a table in the same database in MySQL

Hi there, I have a large table (several million rows) in a MySQL (version 5.0) database that has data inserted into it at a very frequent rate. There are also less frequent select statements done against the database that only required the latest data (i.e. the newest 10000 rows), is there a way to create a table that would keep a copy...

Ant colony optimization using .NET

Hi everybody. I'm looking for a .NET-Class library or .NET-Framework which implements ant colony optimization. Can you give me any links, resources, etc. about this topic. ...

MySQL: optimizing a JOIN query

Say I have two MyISAM tables: tab_big: id1, id2, id_a, ord (5 billion records) tab_small: id1, id2, id_b (1 billion records) CREATE TABLE IF NOT EXISTS `tab_big` ( `id_a` int(10) unsigned NOT NULL, `id1` int(10) unsigned NOT NULL, `id2` int(10) unsigned NOT NULL, `ord` int(10) unsigned NOT NULL DEFAULT '...

How does speed bit video accelerator work?

What type of optimizations does speed bit video accelerator use. ...

nhibernate cross table query optimization

I have a query I've written with NHibernate's Criteria functionality and I want to optimize it. The query joins 4 tables. The query works, but the generated SQL is returning all the columns for the 4 tables as opposed to just the information I want to return. I'm using SetResultTransformer on the query which shapes the returned data t...