performance

How can I properly load test a new component on a webserver?

We're implementing a new solution in our classic ASP environment that's using COM interop to instatiate a .NET component to do some work. The solution is working great and our team lead wants to make sure that it will perform well under load since this is the first time we'll be working with .NET components on our site. What do I need ...

MySQL performance, inner join, how to avoid Using temporary and filesort

Hi, I have a table 1 and table 2. Table 1 PARTNUM - ID_BRAND partnum is the primary key id_brand is "indexed" Table 2 ID_BRAND - BRAND_NAME id_brand is the primary key brand_name is "indexed" The table 1 contains 1 million of records and the table 2 contains 1.000 records. I'm trying to optimize some query using EXPLAIN and after a l...

Performance characteristics of T-SQL CTEs

Hi guys, I've got some SQL that looks roughly like this: with InterestingObjects(ObjectID, OtherInformation, Whatever) as ( select X.ObjectID, Y.OtherInformation, Z.Whatever from X join Y join Z -- abbreviated for brevity ) -- ...long query follows, which uses InterestingObjects in several more CTEs, -- and then uses those CTE...

How do I look up a SiteMapNode by its URL (or other key)?

I think the C# ASP.NET SiteMap uses URL as a dictionary key internally since it has to lookup by URL all the time, and forces them to be unique. I want to use that lookup table, but I can't seem to find access to it. What is the most efficient way to get a specific SiteMapNode by URL? Is there access to it? My use case is that I wa...

Unreasonable WPF DataGrid Loading Time

I've always had long loading times with WPF DataGrids, and I cannot find any similar reports online, so I suspected that I was doing something wrong. Now I am sure of it, since adding layout complexity considerably slows down execution. In a very simple layout, the DataGrid populates instantaenously, whereas the code below takes around...

Does nesting affect efficiency?

Consider languages like Python or JavaScript that allow functions to be nested like this: print(vector(a * b),(a * c),(b * c))) or flat like this: i = (a * b) j = (a * c) k = (b * c) V = vector(i,j,k) print(V) How much does the different format affect performance? Can valid generalizations be made, or does it vary a lot by language...

SQLite - table order in FROM clause affects query plan, why? (no explicit joins here)

Question to SQLite database engine. I have fairly complex question, which finds path in directed graph between two sets of known nodes, with exactly one node between (to be precise, path in public transport routes, but it has graph representation). Now something unexpected - there are no explicit JOINs in question (only conditions in WH...

glBitmap questions

I'm working with a legacy piece of code in some stuff for work which uses glBitmap() calls to draw bitmap icons. My issue is that it's rather slow once you get to drawing about 1000 icons at once. It slows down to about a 1- to 2-second refresh rate, and I'd like to see if I can make it faster than that. First I should probably descri...

Why tuple is faster than list?

Sorry because this is a noob question. I'm reading Dive into Python, and just read "tuple is faster than list". http://diveintopython3.org/native-datatypes.html#tuples Tuple is immutable, and list is mutable, but I don't quite understand why tuple is faster. Anyone did a performance test on this? Thanks. ...

Does the placement of a try-catch block affect performance?

Does the placement of a try-catch block affect performance? EXAMPLE 1: try-catch block inside of the while-loop while (true) { try { // ... read from a file } catch (EOFException e) { break; } } EXAMPLE 2: try-catch block surrounds the while-loop try { while (true) { // ... read from a file ...

C++, best practices, int or size_t?

Possible Duplicate: When to use std::size_t? hello. Assuming usage patterns are the same (i.e. no negative numbers), which is preferable to use for various indexes, int or size_t type? Is there performance difference in your experience on 64-bit Intel between the two? Thank you ...

which one is faster/smarter and why: COUNT(*) or storing the numbers each the do something

PHP $total_points = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM account WHERE id='$id'"),0) Mysql account table |user_id| mysql points table |id | user_id | points | or PHP $total_points = mysql_query("SELECT points FROM account WHERE id='$id'"); Mysql account table |user_id| points | Mysql points table |id | u...

fastest way to compare two Set in Java

Hello, I am trying to optimize a piece of code which compares elements of list. Eg. public void compare(Set<Record> firstSet, Set<Record> secondSet){ for(Record firstRecord : firstSet){ for(Record secondRecord : secondSet){ // comparing logic } } } Please take into account that the number of recor...

Merging two datasets in Python efficiently

What would anyone consider the most efficient way to merge two datasets using Python? A little background - this code will take 100K+ records in the following format: {user: aUser, transaction: UsersTransactionNumber}, ... and using the following data {transaction: aTransactionNumber, activationNumber: assoiciatedActivationNumber}, ...

64-bit Performance Advantages

What is the source of the performance advantage 64-bit applications have over 32-bit applications? I'm assuming there is a performance advantage because programs like WinRAR advertise it. Also, can we get these performance advantages simply by switching to a 64-bit compiler, or are there any changes in code that need to be made? Answer...

How to fastly select data from Oracle

Hello, i have the following Oracle table: GAMES id_game int id_user int dt_game DATE Before creating a new record i must check that the same user has not inserted a game more that N times a day. I'm actually selecting the number of games played today in this way: select count(1) as num from GAMES where id_user=ID_US...

SQL Server performance deterioration

I'm currently dealing with performance/memory consumption optimizations of our application. One of the tasks to perform is to replace all blobs in the a table that correspond to empty arrays with null values; this should reduce db size, memory consumption and speed up the load. Here is the table definition: CREATE TABLE [dbo].[SampleTab...

rails eager loading :select

I have model called VoteTopic with the following associations belongs_to :user belongs_to :category has_many :comments has_many :vote_items, :dependent => :destroy has_many :votes, :through => :vote_items I use Searchlogic gem to query for @vote_topics in the index action as follows.. scope_procedure :all_approved, lambda {status_equ...

Even the most simple query takes half a second on to any table

I created an Innodb table with a id and name column and running this query insert into test (name) VALUES('test'); takes .5 seconds even SELECT id FROM test LIMIT 1 or select 1 takes .5 seconds or so Any suggestions on where I can read more about how to improve the speed would be helpful. I would imagine these queries shouldn...

authlogic current_user tracking

I use authlogic for authentication and paperclip for handling user's profile picture attachments. I use the following method to get the current_user def current_user_session return @current_user_session if defined? (@current_user_session) @current_user_session = UserSession.find end def current_user re...