performance

how do i do very fast inserts to SQL Server 2008

I have a project that involves recording data from a device directly into a sql table. I do very little processing in code before writing to sql server (2008 express by the way) typically i use the sqlhelper class's ExecuteNonQuery method and pass in a stored proc name and list of parameters that the SP expects. This is very convenien...

How do you share pre-calculated data between calls to a Rails web service?

I have a Rails app that allows users to build up a network structure and then ask questions about how to navigate around it. When adding nodes and connections these are just saved to the database. At the point you make a query of the network I calculate the shortest path from any node to any other node. Constructing this in memory tak...

Are .NET 4.0 Runtime slower than .NET 2.0 Runtime?

After I upgraded my projects to .NET 4.0 (With VS2010) I realized than they run slower than they were in .NET 2.0 (VS2008). So i decided to benchmark a simple console application in both VS2008 & VS2010 with various Target Frameworks: using System; using System.Diagnostics; using System.Reflection; namespace RuntimePerfTest { class...

Storing cached data - what amount of formatting?

Hi everyone, I am in the middle of a web app and we're just about to start with a cache-layer that features memcache and disk-based cache. We just questioned ourself - what level/amount of formatting should we use on the stored cache data? Let say that we have a database table called articles. Articles table have a number of columns ...

Pros and cons with automated/manual cache

Hi everyone, I am thinking a lot about whether to head for a complete automated cache or manual cache. Our automatic approach would be a solution that digs through the database, queries and format each potential and future data request and saves it to an appropriate cache storage(memcache or disk based). Data would then not be invalida...

Using cassandra instead of memcache?

Hi! I keep reeding those articles from different sources that big sites are switching from memcache to cassandra. Coming from a mySQL background, I'll get a slight headache trying to see the pros/cons when compared to each other. Can you help me out to learn more about this? ...

Java language convention; getters/setters

Public class Example { private int number; public Example(int number){ this.number = number; } public int getNumber(){ return number; } public void setNumber(int number){ this.number = number; } public static void main(String[] args){ Example e = new Example(5); What ...

Migrating from hand-written persistence layer to ORM

Hi community, We are currently evaluating options for migrating from hand-written persistence layer to ORM. We have a bunch of legacy persistent objects (~200), that implement simple interface like this: interface JDBC { public long getId(); public void setId(long id); public void retrieve(); public void setDataSource(...

Is it bad for performance to extract variables from an array?

Hi everyone, I have found out about the great extract function in PHP and I think that it is really handy. However I have learn that most things that are nice in PHP also affects performance, so my question is which affect using the extract can have, seen in a performance perspective? Is it a no-no to use for big applications to extrac...

Optimizing a MySQL query that finds duplicate data

I have a query that I use for finding duplicate data. I have found that lately the query is very slow, and only getting slower. This is the query I am using (columns renamed): SELECT col1, COUNT(col1) AS Counter FROM people GROUP BY col1 HAVING (Counter > 1) I have indexed col1 (which is a varchar(500)), but the q...

GXT Performance Issues

Hi All, We are working on a rather complex system using GXT. While everything works great on FF, IE (especially IE6) is a different story (looking at more than 10 seconds until the browser renders the page). I understand that one of the main reasons is DOM manipulation which is a disaster under IE6 (See http://www.quirksmode.org/dom/in...

Bulk inserting best way to about it? + Helping me understand fully what I found so far

Hi So I saw this post here and read it and it seems like bulk copy might be the way to go. http://stackoverflow.com/questions/682015/whats-the-best-way-to-bulk-database-inserts-from-c I still have some questions and want to know how things actually work. So I found 2 tutorials. http://www.codeproject.com/KB/cs/MultipleInsertsIn1dbT...

Performance, serve all CSS at once, or as its needed?

As far as I know, these days there are two main techniques used for including CSS in a website. A) Provide all the CSS used by the website in one (compressed) file B) Provide the CSS for required by the elements on the page that is currently being viewed only Positives for A: The entire CSS used on the site is cached on first visit via...

Performance Testing Versus Unit Testing

I'm reading Osherove's "The Art of Unit Testing," and though I've not yet seen him say anything about performance testing, two thoughts still cross my mind: Performance tests generally can't be unit tests, because performance tests generally need to run for long periods of time. Performance tests generally can't be unit tests, because ...

MySQL - What is wrong with this query or my database? Terrible performance.

SELECT * from `employees` a LEFT JOIN (SELECT phone1 p1, count(*) c, FROM `employees` GROUP BY phone1) b ON a.phone1 = b.p1; I'm not sure if it is this query in particular that has the problem. I have been getting terrible performance in general with this database. The table in question has 120,000 rows. I have tried this particular q...

How to solve the performance decay of a VB.NET 1.1 application?

I have single-thread windows form application written with VB.NET and targeting Framework 1.1. The software communicates with external boards through a serial interface, and it mainly consist of a state machine that run some tests, driven in a loop done with a Timer and an Interval of 50ms. The feedback on the user interface is done thr...

Is memcached a dinosaur in comparison to Redis?

Hi everyone, I have worked quite a bit with memcached the last weeks and just found out about Redis. When I read this part of their readme, I suddenly got a warm, cozy feeling in my stomach: Redis can be used as a memcached on steroids because is as fast as memcached but with a number of features more. Like memcached, Redis al...

Why does dojo parsing time depend on css and images availability?

I have been profiling javascript on my page that uses dojo widgets. I don't use explicit parsing - the parser runs on page load. What I noticed is that if I clear browser cache before refreshing the page, dojo parsing takes much more time than if all the files are already cached. Note that we build all the required dojo modules int...

Fast read of certain bytes of multiple files in C/C++

I've been searching in the web about this question and although there are many similar questions about read/write in C/C++, I haven't found about this specific task. I want to be able to read from multiple files (256x256 files) only sizeof(double) bytes located in a certain position of each file. Right now my solution is, for each file:...

Are conditional subqueries optimized out, if the condition is false?

I have a table foo and a table bar, where each foo might have a bar (and a bar might belong to multiple foos). Now I need to select all foos with a bar. My sql looks like this SELECT * FROM foo f WHERE [...] AND ($param IS NULL OR (SELECT ((COUNT(*))>0) FROM bar b WHER...