Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALL


  Why (offset, limit) is slow in database select?

Starting from a problemFive years ago when I was working at Tencent, I found that MySQL request speed was very slow in the pagination scenario. With only 100,000 data, a select query on a single machine took about 2-3 seconds. I asked my mentor why, and he asked in return, "In an indexing scenario, what is the time complexity to get the nth largest number in MySQL?"The pursuit of the answerConfirming the scenarioAssuming there is an index on the "status" column, a query like "select * from table where status = xx limit 10 offset 10000" will be very slow. Even with a small amount of data, there...

3,002 0       MYSQL OFFSET LIMIT SLOW


  One reason why mcrypt responds slowly

This morning one colleague came over and talked about one script which used mcrypt responded very slowly, the server configurations are fine. But the reason for the slowness is unknown.Here is one script which reproduces the issue:<?php$dmcryptText = "dummy";$key = "foobar";$size = mcrypt_get_iv_size(MCRYPT_BLOWFISH,MCRYPT_MODE_ECB); $iv = mcrypt_create_iv($size); //Take care $m = mcrypt_ecb(MCRYPT_BLOWFISH, $key, $dmcryptText, MCRYPT_DECRYPT, $iv);var_dump($m);When 20 requests of this script are sent to the server in parallel, the response time of Apache server increases rapidly.The r...

9,131 8       PHP SOLUTION SLOW MCRYPT RESPONSE


  Why Dynamic Programming Languages Are Slow

In a statically typed language, the compiler knows the data-type of a variable and how to represent that.In a dynamically-typed language, it has to keep flag describing the actual type of the value of the variable, and the program has to perform a data-dependent branch on that value each time it manipulates a variable.  It also has to look up all methods and operators on it.The knock-on effect of this on branching and data locality is lethal to general purpose runtime performance.That’s why the dynamic language JIT benchmarks emphasise near-C speed on small inner loops but steer cl...

2,491 0       ANALYSIS SLOW DYNAMIC LANGUAGE


  Slow Datagridview... Oh No!

So we all have been here, I had finished a project using VS2008, implementing  Datagridviews on litterally each and every form of the system. This had been a requirement from the onset as to ensure easy searching,navigation and capturing of data. So the data capture ladies start doing their thing and low and behold the dreaded call... they are unhappy with the speed of the DataGridView. I had to agree with them, the repaint of the and overall perfromance of the grid is awfull. So started a tedious process of trying to speed this up...The first step was to look at ...

5,632 0       C# SOLUTION SLOW DATAGRIDVIEW


  Supercolliding a PHP array

Did you know that inserting 2^16 = 65536 specially crafted values into a normal PHP array can take 30 seconds? Normally this would take only 0.01 seconds.This is the code to reproduce it:<?php echo '<pre>';$size = pow(2, 16); // 16 is just an example, could also be 15 or 17$startTime = microtime(true);$array = array();for ($key = 0, $maxKey = ($size - 1) * $size; $key <= $maxKey; $key += $size) { $array[$key] = 0;}$endTime = microtime(true);echo 'Inserting ', $size, ' evil elements took ', $endTime - $startTime, ' seconds', "\n";$startTime = microtime(true);$array = arra...

2,565 0       PHP ARRAY HASHTABLE SLOW COLLIDING


  This Is Why Your Website Is Slow

Click for a larger imageGhostery, the browser plugin that allows its users to "track the trackers," just released data on the tags, widgets and analytics on websites that are the worst in terms of slowing page loads to a crawl.Update: Ghostery discovered an error in their original data set. It appears that Millenial Media was not on this year's list at all, and the #2 slot belonged to AdFunky. Both the text and the graph above have been changed to reflect this.Any webmaster worth his or her salt already knows that slow page loads adversely affect Google rank and pageviews, but not everyone see...

2,630 0       WEB APPLICATION PERFORMANCE REASON SLOW LAGTAG