speed

Mysql, does using index for selects with operators >,< improve performance?

I need to select a row from table that has more than 5 millions of rows. It is table of all IP ranges. Every row has columns upperbound and lowerbound. All are bigintegers, and the number is integer representation of IP address. The select is: select * from iptocity where lowerbound < 3529167967 and upperbound >= 3529167967 ...

Android Voice Recognition activity called in 'onCreate' method causes app to load slowly

In my android app I call the voice recognition in my onCreate method of my startup activity. I have made it a preference to start up with the voice control or not. However, the app takes about 5-7 seconds to load when voice recognition is on. When it is off, the app starts almost instantly. Below is sample code, I have added Free_Form...

ASP.NET WebParts and Google Chrome

Hi there I started learning ASP.NET these days. Google Chrome is my default browser and I'm also testing my applications in Google Chrome. I recognized that some Elements of ASP.NET won't run in real time when I use Chrome. For Example ASP.NET WebParts. If I change the modus of the WebPartManager from default to edit (or something else...

Using mysql COUNT(*)

Why is COUNT(*) so much quicker than COUNT(field), Even when field is an index? I am using MySQL ...

How to increase ajax asynchronous postback speed - asp.net

Hello dear programmers. I am developing a web based mmorpg. so speed is very vital for me since people don't like slow games :) i have a map system which uses ajax and asynchronous postbacks for walking. so i want to make it faster as much as possible. if anybody can spend some time at my page and make suggestion for me i appreciate t...

Systems programming in haskell?

Hey guys, Ive been thinking...Is it possible to go very low level in functional languages like haskell?(like making a kernel or device driver).And will functional features (like monads) be fast and efficient there? Thanks in advance ...

Howto speedup IE6 page/table rendering?

Edit: My problem is fixed thanks to @Grumpy - still, if you have general advices regarding to IE6 - feel free to answer. Hi there, I have a customer still using IE6 (I tried to let them upgrade, but it is slowly going on because of the large user base). On one page there are is a table containing prices (11 columns with 24 rows per en...

Inserting a block of data into a huge file with fortran

Hi All, I have some massive (4.6 million lines) data files that I'm trying to edit with fortran. Basically, throughout the files is a series of headers followed by a table of numbers. Something like this: p he4 blah 99 ggg 1.0e+01 2.0e+01 2.0e+01 2.0e+01 5.0e+01 2.0e+01 . . 3.2e+-1 2.0e+01 1.0e+00 ...

in PHP, which is faster - reading a file or a database call?

I've a web app built in PHP with Zend on a LAMP stack. I have a list of 4000 words I need to load into memory. The words have categories and other attributes, and I need to load the whole collection every time. Think of a dictionary object. What's the best way to store it for quick recall? A flat file with something like XML, JSON or a ...

MongoDB's geospatial index: how fast is it?

I'm doing a where in box query on a collection of ~40K documents. The query takes ~0.3s and fetching documents takes ~0.6 seconds (there are ~10K documents in the result set). The documents are fairly small (~100 bytes each) and I limit the result to return the lat/lon only. It seems very slow. Is this about right or am I doing somethi...

Need help speeding up this jQuery process

Hi, I've created the following process. Basically it loops through a gigantic unordered list with multiple level nested lists and creates a 2 level nested unordered list. It works well but is very slow in IE7. FireFox and Safari have no big problems with it. Not very good at jQuery I was wondering if I could speed up this by using bette...

Converting while to generator 3.4 times slow down

What is happening? Can somebody explain me what happens here, I changed in tight loop: ## j=i ## while j < ls - 1 and len(wordlist[j]) > lc: j+=1 j = next(j for j in range(i,ls) if len(wordlist[j]) <= lc) The commented while version ran the whole program: 625 ms, the next generator version ran the wh...

Which is better for JavaScript load-time: Compress all in one big file or load all asynchronously?

Hi, A simple question that I'm not sure if it has a short answer! Description I have a files of JavaScript that to be loaded in a website here are some notes about them: They are all comes from the same domain (no cross domain loading needed) They are identical around the website. There are several files, like jQuery, and 5 other plu...

Which is the best route to take when uploading images from my Rails app to Amazon's S3?

I have a web app in which users can upload an avatar under 700kb. That's the only part of the application dealing with uploading images (so I won't be dealing with an exceptionally heavy load). I was wondering what the best way is to go about this. Currently I'm using Paperclip and I wan't to store all of the images on Amazon's S3. Opti...

Optimizing use of database queries

Is it faster to do a single database query that finds all the results you need for a page, then do several loops through it with if/else statements to extract what you want to show in each section, or to do several database queries selecting the exact data you require and then just loop through each one separately? For instance: @compl...

Does .Net / C#'s speed degrade with increased field depth?

Is there any execution speed difference between the following two lines of code? I cannot tell from looking at the IL: int x = MainObject.Field1; int x = MainObject.Public.Fields.Field1; I know from Delphi (native code), there is no difference. ...

Python if vs try-except

I was wondering why the try-except is slower than the if in the program below. def tryway(): try: while True: alist.pop() except IndexError: pass def ifway(): while True: if alist == []: break else: alist.pop() if __name__=='__main__': from timeit imp...

Fastest way to loop every number with conditions

Given a 64 bit integer, where the last 52 bits to be evaluated and the leading 12 bits are to be ignored, what is the fastest way to loop every single combination of 7 bits on and all other bits off? Example: First permutation: 0[x57]1111111 Last permutation 00000000000011111110[x45] Where 0[xn] means n off (zero) bits. Speed is...

Is there a speed benefit to using unsafe code in .Net to swap objects of complex types?

Here is my current swap code for swapping 2 KeyValuePair objects in an array: KeyValuePair<int, T> t = a[i]; a[i] = a[j]; a[j] = t; Would there be any speed advantage to using unsafe code and merely swapping the pointers of the 2 objects? Or does the complier effectively boil this safe code down to effectively ...

Is it faster to have more files in fewer folders, or more folders with fewer files?

Hey all. I'm creating an application that is going to be generating and storing millions of images. Before I start on this, I'm wondering if anyone knows if it's better to generate more folders and only keep a few files in each, or should I use a few folders and fill them up with lots of files? The generator will be written in C++ and...