performance

Performance of unused fields in an SQL View

I'm using MS SQL Server. When I define the database schema I define a (non-materialized) view, which includes many fields, for example as follows (where "Topic" is the name of a table, and the view is a self-join on the Topic table): CREATE VIEW View_Topic_Ancestor AS SELECT Subordinate.Id AS Subordinate_Id, Subordinate.Folder_...

finding long repeated substrings in a massive string

I naively imagined that I could build a suffix trie where I keep a visit-count for each node, and then the deepest nodes with counts greater than one are the result set I'm looking for. I have a really really long string (hundreds of megabytes). I have about 1 GB of RAM. This is why building a suffix trie with counting data is too ine...

How can I improve Visual Studio performance on a slow hard drive?

I currently have a laptop with a 5400rpm drive. It has visual studio installed and whilst it's just ok for working on, I've read plenty of places that you can get a pretty nice performance boost from VS just by increasing the drive speed. I don't have that luxury, but I was wondering if I might be able to get some performance benefit f...

PostgreSQL performance issue

Hi, I can see in the postgresql logs that certain simple queries (no joins and using only match conditions that use indexes) take anywhere from 1 to 3 seconds to execute. I log queries that take longer than a second to execute thus there are similar queries which execute under a second which don't get reported. When I try the same quer...

Javascript (jQuery) performance measurement and best practices (not load time)

I'll say right off the bat that this question is NOT about load times; I know about YSlow, the Firebug profiler, and whatever best practices and tools googlage reveals about page component load times. I am asking what good profiling tools or libraries or add-ons there are for measuring actual execution of Javascript (specifically jQuery...

How to Best Perform Client-Side Validation Against Moderate Size Array

Overview: I have an array of 20 byte strings that needs to be stored on a web page for use in user entry validation. I anticipate between 25 and 1000 elements in that array. Considerations: 1. The web client will be a mobile device with reduced memory and processor capability. 2. I am limited to client-side validation only (technical l...

When using the latest jdbc driver for SQL Server 2005/2008 how do prepared statements, views, and stored procedures compare regarding performance?

When using the latest Microsoft jdbc driver for SQL Server 2005/2008 how do prepared statements, views, and stored procedures compare regarding performance? If I have a plain old select statement with some dynamic where clauses will I see benefits from moving from straight SQL in a prepared statement to a view or even stored procedure?...

Find() vs. enumeration on lists

Hi all, I'm working with a code base where lists need to be frequently searched for a single element. Is it faster to use a Predicate and Find() than to manually do an enumeration on the List? for example: string needle = "example"; FooObj result = _list.Find(delegate(FooObj foo) { return foo.Name == needle; }); vs. string ne...

Web Service not caring about Timeout property

I'm using an automatically created (with wsdl.exe and the GUI-based "Add web reference" command) web service for LyricWiki.org. However, since my internet connection is sucking lately, it's been taking ages to complete and is annoying me. I'm trying to make it timeout in 2000ms by using the .Timeout property, but it still hangs. I also ...

What is a suitable replacement for the SQL Like operator to increase performance?

I'm working on an application that runs on Windows Mobile 6 that needs to be able to retrieve all items from an item table that contain a given string (provided by the end user) within the item's description field. The problem is that there are approximately 170,000 items in the table. Since I need to return all items that contain the st...

Memory Efficient Programming

What are some best practice for "Memory Efficient C programming". Mostly for embedded/mobile device what should be the guidelines for having low memory consumptions ? I guess there should be separate guideline for a) code memory b) data memory ...

MySQL transaction support with mixed tables

It seems like I will be needing transaction with MySQL and I have no idea how should I manage transactions in Mysql with mixed InnoDB/MyISAM tables, It all seems like a huge mess. You might ask why would I ever want to mix the tables together... the anwer is PERFORMANCE. as many developers have noticed, InnoDB tables generally have bad ...

Why are compilers so stupid?

I always wonder why compilers can't figure out simple things that are obvious to the human eye. They do lots of simple optimizations, but never something even a little bit complex. For example, this code takes about 6 seconds on my computer to print the value zero (using java 1.6): int x = 0; for (int i = 0; i < 100 * 1000 * 1000 * 1000...

MySQL versus SQL Server Express Performance Comparison

I have a somewhat complex query with roughly 100K rows. The query runs in 13 seconds in SQL Server Express (run on my dev box) The same query with the same indexing and tables takes over 15+ minutes to run on MySQL 5.1 (run on my production box - much more powerful and tested with 100% resources) And sometimes the query crashes the ma...

With so much system resources available, how sure are you your code is tuned?

With CPUs being increasingly faster, hard disks spinning, bits flying around so quickly, network speeds increasing as well, it's not that simple to tell bad code from good code like it used to be. I remember a time when you could optimize a piece of code and undeniably perceive an improvement in performance. Those days are almost over....

If else if or Switch case

Which one is better when performance is taken into consideration an if else if or switch case Duplicate: http://stackoverflow.com/questions/395618/ifelse-vs-switch ...

Need to load the whole postgreSQL database into the RAM.

How do I put my whole PostgreSql database into the RAM for a faster access?? I have 8GB memory and I want to dedicate 2 GB for the DB. I have read about the shared buffers settings but it just caches the most accessed fragment of the database. I needed a solution where the whole DB is put into the RAM and any read would happen from the R...

Difference between declaring variables before or in loop?

Hi, I have always wondered if, in general, declaring a throw-away variable before a loop, as opposed to repeatedly inside the loop, makes any (performance) difference? A (quite pointless example) in Java: a) declaration before loop: double intermediateResult; for(int i=0;i<1000;i++){ intermediateResult = i; System.out.println...

Java for Audio Processing is it Practical?

Is Java a suitable alternative to C / C++ for realtime audio processing? I am considering an app with ~100 (at max) tracks of audio with delay lines (30s @ 48khz), filtering (512 point FIR?), and other DSP type operations occurring on each track simultaneously. The operations would be converted and performed in floating point. The sys...

Which is faster? ByVal or ByRef?

In VB.NET, which is faster to use for method arguments, ByVal or ByRef? Also, which consumes more resources at runtime? (RAM) Edit: I read through this question, but the answers are not applicable or specific enough. ...