What are the ways by which we can reduce the size of the HTML Response sent by an asp.net application?
I am using Controls which are not owned by me and it produces output with white spaces. I am interested in Minifying the entire HTML output of the page just like how google does (View source www.google.com) to improve the timing.
Is t...
I seem to remember being able to print out (or locate) the specific switches that each -O<num> option turns on. Can you remind?
Thanks!
...
I'm using an std::map (VC++ implementation) and it's a little slow for lookups via the map's find method.
The key type is an std::string.
Can I increase the performance of this std::map lookup via a custom key compare override for the map? For example, maybe std::string < compare doesn't take into consideration a simple string::size()...
I want to search a table to find all rows where one particular field is one of two values. I know exactly what the values would be, but I'm wondering which is the most efficient way to search for them:
for the sake of example, the two values are "xpoints" and "ypoints". I know for certain that there will be no other values in that field...
I'm working on adding globalization to my product cataloge and I have made it work. However, I feel that the underlaying SQL query isn't performing as well as it could and I could need some advice on how to change my Linq To SQL query to make it more efficient.
The tables that are used
Product contains a unique id for each product. Thi...
In my independent study of various compiler books and web sites, I am learning about many different ways that a compiler can optimize the code that is being compiled, but I am having trouble figuring out how much of a benefit each optimization will tend to give.
How do most compiler writers go about deciding which optimizations to imple...
Here is my short implementation of Russian Peasant Multiplication. How can it be improved?
Restrictions : only works when a>0,b>0
for(p=0;p+=(a&1)*b,a!=1;a>>=1,b<<=1);
...
I am maintaining a website with currently about 800 concurrent users. The business plan says that this number will be 10x higher in one year.
This is my current configuration:
<Connector port="8080" address="${jboss.bind.address}"
maxThreads="500" maxHttpHeaderSize="8192"
emptySessionPath="true" protocol="HTTP/1.1"
enableLookups=...
What would be the best way to check that a std::vector is sorted ? Is there something faster than a loop checking that v[i]<=v[i+1] ? Is it faster/cleaner with iterators ? Or is it actually better to just call sort every time (though the "v is already sorted" case is quite common) ?
We can safely assume the vector only contains PODs, us...
I find it much easier to write MXML classes with embedded Script than trying to make an actionscript file.
I was wondering however what kind of overhead there is of using an MXML file - in terms of file size. I'm not especially concerned about performance, but if that is relevant would be interested in any findings.
Obviously I'm talki...
If something is making a single-thread program take, say, 10 times as long as it should, you could run a profiler on it. You could also just halt it with a "pause" button, and you'll see exactly what it's doing. Even if it's only 10% slower than it should be, if you halt it more times, before long you'll see it repeatedly doing the unnec...
I frequently run into large, non-template classes in C++ where simple methods are defined directly in the class body in the header file instead of separately in the implementation file. For example:
class Foo {
int getBar() const { return bar; }
...
};
Why do this? It seems like there are disadvantages. The implementation is not a...
I have two lists of custom objects and want to update a field for all objects in one list if there is an object in the other list which matches on another pair of fields.
This code explains the problem better and produces the results I want. However for larger lists 20k, and a 20k list with matching objects, this takes a considerable ti...
I am looking for things like reordering of code that could even break the code in the case of a multiple processor.
...
The following C# code takes 5 minutes to run:
int i = 1;
string fraction = "";
while (fraction.Length < 1000000)
{
fraction += i.ToString();
i++;
}
"Optimising it" like this causes it to run in 1.5 seconds:
int i = 1;
string fraction = "";
while (fraction.Length < 1000000)
{
// concatenating strings is much faster for sma...
I'm using a logging module that can have reporting enabled/disabled at runtime. Calls generally go something like:
WARN(
"Danger Will Robinson! There are "
+ boost::lexical_cast<string>(minutes)
+ " minutes of oxygen left!"
);
I'm using an inline function for WARN, but I'm curious as to how much optimization is going on...
What is the time complexity of dynamic memory allocation using new, malloc, etc.? I know very little about how memory allocators are implemented, but I assume the answer is that it depends on the implementation. Therefore, please answer for some of the more common cases/implementations.
Edit:
I vaguely remember hearing that heap allo...
Is it possible to free memory allocated by C's alloca() explicitly, before the current function exits? If so,how?
...
I'm writing a Flash game, pretty intensive on CPU.
Besides optimizing it a lot, I would like to be able to play it as players on slow PC's will, because I have a good CPU and I would like to make it also playable on bad CPU's
First I thought that virtualization would help, but I've tried vmware player with an ubunto image and I can't f...
I have a C library with numerous math routines for dealing with vectors, matrices, quaternions and so on. It needs to remain in C because I often use it for embedded work and as a Lua extension. In addition, I have C++ class wrappers to allow for more convenient object management and operator overloading for math operations using the C A...