performance

Best way to implement a dynamic stack type? or Am i abusing realloc?

I'm using an obscure language that doesn't have a native stack type so I've implemented my own. Now, reading on the net i've found a few different approaches to do this. This is my implementation (psuedo code) //push method function Push(int) { Increase (realloc) stack by 4 bytes; Push int into the new memory area; } //pop met...

Is it possible to pull for touch points immediately after touchesBegan: gets called?

Problably you know that iPhone OS makes an artifical delay of about 0.25 seconds after an touchesBegan: occures. This is to check if the user intends to move or not. If the deltas move significantly enough during this time, a touchesMoved: sequence starts. But when you want to implement tactile touch behaviour in your app, you may not w...

PHP, MySQL | Windows vs Linux

Well the title does the explaination. Which one is faster PHP/MySQL on Linux or on Windows. Question 1 I know that MySQL is slower on Windows, because i tried to run a C++ program on Windows to access MySQL, it took a year every time it had to open a connection. When i ported the exact copy into the linux enviornment it was lightning f...

Question about jQuery performance and DOM: why is one method faster than the other?

I was looking at some jQuery performance tips and ran across this one that caught my interest. Check out the following page snippet: <html> <head> </head> <body> <select id ="myList"> </select> <div id ="myList2"> </div> <script language="javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/...

WPF application freeze

Hi I am kind of lost here, and I don't know what to do I have a problem that I don't know what the source of it. We have a large wpf application, that is built similar to prism (composite application) Actually we are using lots of prism library. I wrote a module to replace an existing module. And the application now is loading my modul...

Which constructor is better for StreamResult()?

It's my first time posing a question here. I would like to know which constructor is better in terms of performance for a large xml dom to be written to a test.xml file: new StreamResult(new BufferedWriter(new OutputStreamWriter(new FileOutputStream("test.xml"), "UTF-8"))) Or new StreamResult(new FileOutputStream("test.xml")) Regar...

Page Performance in IE7 with a large page

Ok so I'm writing a failry complex ASP.NET page that has quite a bit of javascript related to it. The problem is the page has alot going on with it but the browser just acts unresponsive alot of the time and lags while the javascript seems to perform fine. In this page, I send down a array list of available items for the user to select...

Bandwidth needed to serve video

We are planning on serving some video on our website. In order to do so we are doing some contingency planning around the bandwidth we will use up during peak times. We are planning on serving a 1 minute video at 150Kbs (we may increase this depending on how much bandwidth we use up). We are steaming the video, rather than embedding it...

How can I speed up a MySQL query with a large offset in the LIMIT clause?

I'm getting performance problems when LIMITing a mysql SELECT with a large offset: select * from table limit m, n; If the offset m is, say, larger than 1,000,000, the operation is very slow. I do have to use "limit m, n" ; I can't use something like "id > 1,000,000 limit n". How can I optimize this statement for better performance? ...

PHP APC in CLI mode

Hi, Does APC module in PHP when running in CLI mode support code optimization? For example, when I run a file with php -f <file> will the file be optimized with APC before executing or not? Presuming APC is set to load in config file. Also, will the scripts included with require_once be also optimized? I know optimization works fine wh...

What is an efficient way to render a large XML collection in ruby/rails?

I'm trying to render a large (ish) array of objects as a plist in Ruby on Rails. The collection currently contains up to 200 objects, each of which is essentially a record (dictionary of keys/values). The overall result format is a plist (as used by Apple) but logically it is not much different from any XML document. The problem I've hi...

File.Copy vs. Manual FileStream.Write For Copying File

My problem is in regards file copying performance. We have a media management system that requires a lot of moving files around on the file system to different locations including windows shares on the same network, FTP sites, AmazonS3, etc. When we were all on one windows network we could get away with using System.IO.File.Copy(source, ...

iphone tableview with a lot of images

I have a tableview that displays a lot of images in the cells, and i am not quit happy about the scroll performance. My tableview is something like the photo app on the iphone. Does anybody knows why the iphone foto app scrolls so damn fast as if their's nothing on the screen. And does anybody has some tips/tricks to increase my perform...

Javascript objects performance

I am unsure how javascript stores objects, and references them. So, I don't know if my plan will cause bad performance. Any insight would be appreciated. I have many divs on a website, and each has a unique id. I have an object constructor: function box_object(box_id){ this.the_box = document.getElementById(box_id); this.rela...

Where to look for synchronized contention evidence in java?

Our Tomcat web application feels slow when it is used by a couple hundred users. The servers are in a hosting company and their reports doesn't show any problem with bandwith or cpu workload, so I suspect that the reason of the slowdowns can be because of contention on some legacy code that we encapsulated under synchronized calls becaus...

boxing on structs when calling ToString()

Hi I've often wondered if the following scenario actually happens in c# If I have a struct but I don't explicitly override any of the methods that derived from object such as ToString(), GetHashCode(), etc then if I declare a local instance of my struct class and call 'ToString()' on it, would my struct get boxed i.e would the CLR conv...

performance of my application using wampserver

I have developed an application using php, mysql and xajax. I always used to test on a setup of which I had installed all applications seperately (apache, php and mysql) and my application was fast (by this I mean that the responsetime of useraction were very low). I recently removed apache, php and mysql and installed wampserver. From ...

Does string.replaceAll() performance suffer from string immutability?

Lets say I called replaceAll() on a big string that replaced 1,000 matching instances. Does it mean that 1,000 strings were created and reassigned in process because of string immutability? Is there any faster alternatives? ...

How to match 2 lists most effectively (fast)?

I have 2 lists<string> of items, source and target. The items in the source list will have 0 to n matches in the target list, but there will not be duplicate matches. Considering both lists are sorted, how would you do the matching most effectively in terms of performance. Example: source = {"1", "2", "A", "B", ...} target = {"1 - new...

Regex Performance Optimization Tips and Tricks

After reading a pretty good article on regex optimization in java I was wondering what are the other good tips for creating fast and efficient regular expressions? ...