performance

Can GPU capabilities impact virtual machine performance?

While this many not seem like a programming question directly, it impacts my development activities and so it seems like it belongs here. It seems that more and more developers are turning to virtual environments for development activities on their computers, SharePoint development being a prime example. Also, as a trainer, I have virt...

MySQL Single Query Benchmarking Strategies

Hello, I have a slow mySQL query in my application that I need to re-write. The problem is, it's only slow on my production server and only when it's not cached. The first time I run it, it will take 12 seconds, then anytime after that it'll be 500 milliseconds. Is there an easy way to test this query without it hitting the query cach...

Is Linq Faster, Slower or the same?

Is this: Box boxToFind = AllBoxes.Where(box => box.BoxNumber == boxToMatchTo.BagNumber); EDIT: Box boxToFind = AllBoxes.FirstOrDefault(box => box.BoxNumber == boxToMatchTo.BagNumber); Faster or slower than this: Box boxToFind ; foreach (Box box in AllBoxes) { if (box.BoxNumber == boxToMatchTo.BoxNumber) { boxToF...

Does PHP's APC reclaim memory after apc_delete() is called?

More generally, does anyone know where the way APC works internally is documented? ...

Best Approach for Checking and Inserting Records

EDIT: To clarify the records originally come from a flat-file database and is not in the MySQL database. In one of our existing C programs which purpose is to take data from the flat-file and insert them (based on criteria) into the MySQL table: Open connection to MySQL DB for record in all_record_of_my_flat_file: if record contain a...

What are the benefits of using properties internally?

Encapsulation is obviously helpful and essential when accessing members from outside the class, but when referring to class variables internally, is it better to call their private members, or use their getters? If your getter simply returns the variable, is there any performance difference? ...

Detecting Connection Speed / Bandwidth in .net/WCF

I'm writing both client and server code using WCF, where I need to know the "perceived" bandwidth of traffic between the client and server. I could use ping statistics to gather this information separately, but I wonder if there is a way to configure the channel stack in WCF so that the same statistics can be gathered simultaneously whi...

MySQL ORDER BY DESC is fast but ASC is very slow

Hello, I'm completely stumped on this one. For some reason when I sort this query by DESC it's super fast, but if sorted by ASC it's extremely slow. This takes about 150 milliseconds: SELECT posts.id FROM posts USE INDEX (published) WHERE posts.feed_id IN ( 4953,622,1,1852,4952,76,623,624,10 ) ORDER BY posts.published DESC LIMIT 0, 50...

Rails: Using memcached on a horizontally partitioned DB

I am using a sharded db - horizontally partitioned. I am using the DataFabric gem from FiveRuns. What would be the implications of using memcached on this? Would it work the same as if I was using ActiveRecord? ...

Is using joins in select clause slow in Oracle?

I would like to write a query like the following select username, (select state from addresses where addresses.username = users.username) email from users This works in Oracle (assuming the result from the inner query is unique). However, is there a performance penalty associated with this style of writing query? ...

How large is a "buffer" in PostgreSQL

I am using pg_buffercache module for finding hogs eating up my RAM cache. For example when I run this query: SELECT c.relname, count(*) AS buffers FROM pg_buffercache b INNER JOIN pg_class c ON b.relfilenode = c.relfilenode AND b.reldatabase IN (0, (SELECT oid FROM pg_database WHERE datname = current_database())) GROUP BY c.r...

mysql medium int vs. int performance?

Hi, I have a simple users table, i guess the maximum users i am going to have is 300,000. Currently i am using: CREATE TABLE users ( id INT UNSIGEND AUTOINCEREMENT PRIMARY KEY, .... Of course i have many other tables that the users(id) is a FOREIGN KEY in them. I read that since the id is not going to use the f...

Minimizing calls to database in rails

Hi guys, i am familiar with memcached and eager loading, but neither seems to solve the problem i am facing. My main performance lag comes from hundreds of data retrieval calls from the database. The tricky thing is that I do not know which set of users i need to retrieve until i have several steps of computation. I can refactor my c...

how to profile silverlight mvvm application with a lot of custom controls

There is a quite big LOB silverlight application and we wrote a lot of custom controls which are rather heavy in drawing. All data is loaded by RIA service, processed and bound (using INofityPropertyChanged interface) to the view. The problem is that first drawing takes a lot time. Following calls to the service (server) and redrawing ...

C: performance of assignments, binary operations, et cetera...

I've heard many things about performance in C; casting is slow compared to normal assignments, functional call is slow, binary operation are much faster than normal operations, et cetera... I'm sure some of those things are specific to the architecture, and compiler optimization might make a huge difference, but I would like to see a ch...

PHP performance difference between passing variables method

Hi everyone, Will there be any measurable performance difference when passing data as values instead of as reference in PHP? It seems like few people are aware of that variables can be passed as values instead of references. Is this common sense or not? ...

LINQ To objects: Quicker ideas?

Do you see a better approach to obtain and concatenate item.Number in a single string? Current: var numbers = new StringBuilder( ); // group is the result of a previous group by var basenumbers = group.Select( item => item.Number ); basenumbers.Aggregate ( numbers, ( res, element ) => res.AppendFormat( "{0:00}", element ) ); ...

How does Android emulator performance compare to real device performance?

I'm looking into writing an Android game, tough I don't curerntly own an Android device. For those of you who own a device, how does the performance on the emulator relate to real device performance? I'm especially interested in graphics related tasks. This obviously depends on both the machine running the emulator, and the specific dev...

How expensive are variables in JavaScript?

How expensive are local variables (var v), global variables (window.v) and cross-global variables (parent.v) in JavaScript, in the major browsers? Has anyone performed any good tests on this one? ...

Is there an Open Source Profiler for .Net 4?

Is there an Open Source Profiler for .Net 4? RedGate Antz is an option but I am looking for an open source alternative. ...