speed

Tips for optimising Database and POST request performance

I am developing an application which involves multiple user interactivity in real time. It basically involves lots of AJAX POST/GET requests from each user to the server - which in turn translates to database reads and writes. The real time result returned from the server is used to update the client side front end. I know optimisation ...

Log4J - Speed of resolving class/method/line references

Does log4J still gather the class, method and line numbers by generating exceptions and inspecting the stack trace? Or has Java been optimized since Sun included their own logging framework. If not, why has there not been any optimizations made since. What is the main challenges in obtaining class, method and line numbers quickly and ...

What is faster- Java or C# (Or good old C)?

I'm currently deciding on a platform to build a scientific computational product on, and am deciding on either C#, Java, or plain C with Intels compiler on Core2 Quad CPU's. It's mostly integer arithmetic. My benchmarks so far show Java and C are about on par with each other, and dotNET/C# trails by about 5%- however a number of my cow...

Why do I get poor performance when rendering different images with UIImage on iPhone

Hi, I'm using UIImage to render a game map from 32x32 blocks. The code is as follows for( int x = 0; x < rwidth; ++x) { for(int y = 0; y < rheight; ++y) { int bindex = [current_map GetTileIndex:x :y]; CGPoint p; p.x = x * tile_size_x; p.y = y * tile_size_x; [img_list[bindex] drawAtPoint:p]; } } This ends up rendering abo...

Do valid web pages load faster?

I am a fan of valid web pages and always spend time passing new sites through the W3C validator. When trying to make a case for why companies should validate web pages I quickly thought of accesibility and the future-proofing of the web site on more primitive devices such as phones, fridges, watches, the next-big-thing etc. However I t...

Reflection Related How much speed am i sacrificing?

private Equipment GenerateDirtyPropertiesOnEntity(Equipment updatedEntity) { updatedEntity.DirtyProperties.Clear(); Equipment originalEntity = GetEquipmentByGuid(updatedEnitity.Guid.Value); Type myType = updatedEntity.GetType(); System.Reflection.PropertyInfo[] properties = myType.GetProperties(); ...

Is method A faster than method B?

This is a canonical question, meant only half-way as a joke. Hopefully, you'll find this before posting any question of the form: Is something faster than something else? Hopefully, the answers below will educate you and prevent you from asking any such questions. Make sure you answer it, bods. I've posted my own thoughts but I've...

Using TeraTerm to send a file, transfer rate, time

Hi! I'm using TeraTerm to transfer a file through a dial up connection, for this I will use ttl scripts in both ends to automatize it. I would like to measure the time it takes to transfer the file, or the transfer rate... but I don't know how to do it? Does anyone have any idea? Thanks a lot ...

Python's FTPLib too slow ?

I have been playing around with Python's FTP library and am starting to think that it is too slow as compared to using a script file in DOS? I run sessions where I download thousands of data files (I think I have over 8 million right now). My observation is that the download process seems to take five to ten times as long in Python th...

Large buffers vs Large static buffers, is there an advantage?

Hello, Consider the following code. Is DoSomething1() faster then DoSomething2() in a 1000 consecutive executions? I would assume that if I where to call DoSomething1() it 1000 times it would be faster then calling DoSomething2() it 1000 times. Is there any disadvantage to making all my large buffers static? #define MAX_BUFFER_LENGTH...

Slow selection in QTreeView, why?

I've recently hit a wall in a project I'm working on which uses PyQt. I have a QTreeView hooked up to a QAbstractItemModel which typically has thousands of nodes in it. So far, it works alright, but I realized today that selecting a lot of nodes is very slow. After some digging, it turns out that QAbstractItemModel.parent() is called way...

Why is this code so slow?

jsc.tools.road.correctType = function() { for(row = jsc.data.selection.startX - 1; row <= jsc.data.selection.endX + 1; row++) { for(col = jsc.data.selection.startY - 1; col <= jsc.data.selection.endY + 1; col++) { if(jsc.data.cells[row-1][col].type != "road" && jsc.data.cells[row+1][col].type != "road" && jsc.data...

will the use of multiple subdomains speed up my website?

i am considering moving my images to a subdomain on my website, and i read somewhere that moving the script to a different one would make it even faster! is it really true? or should i just leave it at what it is if i am not considering a real CDN? ...

Fastest way to convert a Numpy array into a sparse dictionary?

I'm interested in converting a numpy array into a sparse dictionary as quickly as possible. Let me elaborate: Given the array: numpy.array([12,0,0,0,3,0,0,1]) I wish to produce the dictionary: {0:12, 4:3, 7:1} As you can see, we are simply converting the sequence type into an explicit mapping from indices that are nonzero to their...

Faster to query in MYSQL or to use PHP logic

I have a page that will pull many headlines from multiple categories based off a category id. I'm wondering if it makes more sense to pull all the headlines and then sort them out via PHP if/ifelse statements or it is better to run multiple queries that each contain the headlines from each category. ...

while (1) Vs. for (;;) Is there a speed difference?

Long version... A co-worker asserted today after seeing my use of while (1) in a Perl script that for (;;) is faster. I argued that they should be the same hoping that the interpreter would optimize out any differences. I set up a script that would run 1,000,000,000 for loop iterations and the same number of while loops and record the ...

how to test hosting companies's speed for our webpages / web app?

Before we sign up for any hosting company to host our app or pages, i think it probably is good to find out the speed so that if it is too slow, we may as well pay a little more to find a better place to put our app. the question is, is there a way to find out some sites that a hosting company is hosting and what is the best way to test...

Including file in PHP ?

I am developing an application where I have a requirement that I have to include multiple files, as follows: File1.php will include File2.php File2.php will include File3.php File3.php will include File4.php Now, what will be the best and optimized way of doing these. I tried with include() but I think its slowing down my server as ...

How do I turn a conditional chain into faster less ugly code?

I have 9 different grammars. One of these will be loaded depending on what the first line of txt is on the file it is parsing. I was thinking about deriving the lexer/parser spawning into sep. classes and then instantiating them as soon as I get a match -- not sure whether that would slow me down or not though. I guess some benchmarkin...

Which apps are too slow? or: Is multi-core needed?

Just like cars, speed is cool, but: "is speed needed? Will people to pay for it?" Word processing, email and spreadsheets are fast enough, even on underpowered netbooks (they've been fast enough for a decade.) Provided you can play HD video and sound, do people need it to be faster? It seems that games can always use more power, and i...