performance

Best ways to reduce number of DOM elements

Everyone agrees that less DOM elements means better page performance. It means better javascript performance, especially in older browsers. But where are the best places to look to reduce DOM elements? What are the common culprits that you guys have come across that are easy fixes to get that number down? ...

Storing HTML in a Core Data app

As a follow up to this previous question, I have a Core Data-based iPhone app that gets its underlying SQLite database file pre-loaded by a small utility, written in Cocoa, which I also wrote. Basically, I'm taking data from text files and building my data off-line, so the app is as fast as possible when it runs (i.e. no data parsing on ...

How can I improve my sites IE6/7 JS performance?

Hi folks, So I was involved in a site rewrite recently and we've gone live with what’s a big improvement on the previous in every way (no it's not perfect, we live by deadlines and are always improving :D) with one exception: in IE6/7 it will lockup after the page has shown. I know it's the JS as with it disabled it's fast and I'm aware...

Can MYSQL support databases with sizes around 4 GB? Will I have any performance issues?

I am planning to have a database of size more than 12 million records all of them in a single table and no other joins etc, used for search, filtered based on field names of the table, approximately 4 GB size in MYSQL backend and php frontend. Question is can MYSQL support databases with sizes around 4 GB, Will I have any performance is...

Is there any benefit to update new version of jquery library on each release to my site?

Is there any benefit to update new version of jquery library on each release to my site? Can my other added jquery code and plugins stop work on new library added? ...

List<T>.AddRange implementation suboptimal

Profiling my C# application indicated that significant time is spent in List<T>.AddRange. Using Reflector to look at the code in this method indicated that it calls List<T>.InsertRange which is implemented as such: public void InsertRange(int index, IEnumerable<T> collection) { if (collection == null) { ThrowHelper.Throw...

Is there a drop-in replacement for ActiveRecord to_xml that's faster?

I have a large-ish array (~400 elements) of ActiveRecord objects that I need to convert to XML. I've used array.to_xml for convenience, but it's very slow -- about 20 seconds when the server is busy, and about 5 seconds when idle. I've just run a few benchmarks while the server was idle, and found that: the ActiveRecord query (comple...

Which kind information to cache in memory?

It's easy to decide which information to cache in memory in a node-like web-site, where you have few nodes, most popular pages, you can keep in memory. But what about sites where the whole mass of pages has same chances to be required? For example - Wiki-sites or social nets? added Something's wrong with "add comment" button... Well,...

In javascript, is accessing 'window.Math' slower or faster than accessing the 'Math' object without the 'window.'?

I'm kind of curious about what the best practice is when referencing the 'global' namespace in javascript, which is merely a shortcut to the window object (or vice versia depending on how you look at it). I want to know if: var answer = Math.floor(value); is better or worse than: var answer = window.Math.floor(value); Is one bette...

When is the optimization really worth the time spent on it?

After my last question, I want to understand when an optimization is really worth the time a developer spends on it. Is it worth spending 4 hours to have queries that are 20% quicker? Yes, no, maybe, yes if...? Is 'wasting' 7 hours to switch a task to another language to save about 40% of the CPU usage 'worth it'? My normal iteration ...

Some questions about the performance of PHP Objects

Right now since I am new to using Objects in PHP I feel like in my head, I think of a PHP object as being something big and bulky. This makes me want to use them less often, I feel Like I am taking really simple code and really over-complicating it by putting it into objects. If I have a database, cache, session, core, and user objec...

What is meant by CPU Utilization of a process and How can it be decreased?

What is meant by CPU Utilization of a process? How to measure it? What are the means for reducing it? I have always been confused with this concept. I have tried to measure the CPU used by using 'top' command in the Linux. But, what I notice is, when there are no other user process running, then my process seem to spike up and take ...

Outliers during Performance Evaluation

Hello all, I am trying to do some performance measurements using Intels RDTSC, and it is quite odd the variations I get during different testruns. In most cases my benchmark in C needs 3000000 Mio cycles, however, exactly the same execution can in some cases take 5000000, almost double as much. I tried to have no intense workloads runni...

What's your all-in-one web resource optimizer?

I'm working with SmartOptimizer: minify js and css, use css data uris, add far expire headers and other features. (http://farhadi.ir/works/smartoptimizer) It works fine, but i don't know if exists a similiar application with similar or best tools (like Google Closure, CSScaffold,..) If you're not sure witch is better, what's your favour...

ruby / rails / mysql performance degraded on Snow Leopard

I've burned a bunch of hours on this. I'm not having problems getting things to build, but I am seeing that my test suite runs about 2x slower than when I was on OS X 10.5.x . I've spent a lot of time playing around with different optimization settings (learning to avoid homebrew's llvm-gcc compilation). I've just learned that I needed t...

Check load on mysql database

Hi guys, What would be the best ways to monitor mysql performance and load, queries per second, total queries over a hour etc? Thanks! ...

Is it.. Good / Bad / Okay ... to use IF/While Conditions in Stored Procedures ?

My primary concern is with SQL Server 2005... I went through many website and each tells something different. What are the scenarios that are good / ok to use.. For example does it hurts to even set variable values inside IF or only if I run a query. Supposing my SPs is building a dynamic SQL based of several conditions in Input Param...

how to select a field from a row that is chosen by group-by in mySQL

I have a GIANT MYSQL database that contains 100,000,000 records. Simplified, three of my columns are ID, date and time, i have several indexes over id and date ( ID , DATE , ID&DATE ) so no performance problem on join select id, max(date) as last_record from mytable where date < "2010-01-02" mytable /-----------------...

Descendant selectors or specific classes?

Suppose I have this markup: <div id="#titles"> <p>Intro text <span>text text</span> text text</p> <ul> <li>text text text</li> <li>text <span>other text</span> text text more text</li> <li>text text text</li> </ul> </div> and I want to style the span which is inside the li is it better to use the descendant selector #titles li span or...

how to suggest gcc compiler more probable branch

Example: if (almost_always_false_condition) { // do something } Is there a way to suggest compiler that in 99% condition will be false. The condition calculation takes ~60 cycles to be checked, and it cannot be calculated at compile time by compiler itself. (gcc 4.3) ...