overhead

Overhead from using Dependency Injection

Does dependency injection potentially cause large overhead? I would imagine so, especially if the resolver is called many times (which is quite likely looking at pattern examples)? Or am I thinking wrong? Unfortunately I can't test for myself as I have never used it but planned on using it. ...

Java: Expected overhead of the rmi protocol

Hi there! Within my program I'm using two RMI servers, which provide different methods, to simulate a simple network protocol between two notebooks. From my trace log I can see that the transmission time of a "packet" currently varies between 850 and 1100 ms. Are the transmission times in the expected range? Is the overhead of the RMI...

Overhead of a .NET array?

I was trying to determine the overhead of the header on a .NET array (in a 32-bit process) using this code: long bytes1 = GC.GetTotalMemory(false); object[] array = new object[10000]; for (int i = 0; i < 10000; i++) array[i] = new int[1]; long bytes2 = GC.GetTotalMemory(false); array[0] = null; // ensure no garbage collectio...

Overhead of a Round-trip to MySql?

So I've been building django applications for a while now, and drinking the cool-aid and all: only using the ORM and never writing custom SQL. The main page of the site (the primary interface where users will spend 80% - 90% of their time) was getting slow once you have a large amount of user specific content (ie photos, friends, other ...

How can I get a generic list from a datatable with the lowest overhead?

I'm looking for best practices here. Sorry. I know it's subjective, but there are a lot of smart people here, so there ought to be some "very good" ways of doing this. I have a custom object called Employee. That object has seven properties like name, phone, email, and so on. There is also a table in my SQL database called tblEmployees...

Do potential exceptions carry an overhead?

Will a piece of code that potentially throws an exception have a degraded performance compared a similar code that doesn't, when the exception isn't thrown? ...

Overhead for MySQL SELECTS - Better to Use One, or Many In Sequence

Is there an appreciable performance difference between having one SELECT foo, bar, FROM users query that returns 500 rows, and 500 SELECT foo, bar, FROM users WHERE id = x queries coming all at once? In a PHP application I'm writing, I'm trying to choose between a writing clear, readable section of code that would produce about 500 SEL...

Sql wildcard: performance overhead?

I've Googled this question and can't seem to find a consistent opinion, or many opinions that are based on solid data. I simply would like to know if using the wildcard in a SQL SELECT statement incurs additional overhead than calling each item out individually. I have compared the execution plans of both in several different test querie...

F# Serialize Discriminated Union why so many bytes?

I'm trying to serialize some data for a UDP packet stream and I'm getting a huge overhead from serialization. If I encode a FileData with a 1k Byte array I get back 2312 bytes. How would I reduce this overhead without encoding and decoding everything myself? [<Serializable>] type Response = | FileSize of String * int64 | FileD...

In what ways do C++ exceptions slow down code when there are no exceptions thown?

I have read that there is some overhead to using C++ exceptions for exception handling as opposed to, say, checking return values. I'm only talking about overhead that is incurred when no exception is thrown. I'm also assuming that you would need to implement the code that actually checks the return value and does the appropriate thing, ...

What bookkeeping data does a Delphi dynamic array contain?

Here's a simple program to check memory allocation. Checking before and after values with Task Manager suggests that each dynamic array takes up 20 bytes of memory at size = 1. The element size is 4, which means 16 bytes of overhead for bookkeeping data. From looking through system.pas, I can find an array length field at -4 bytes, an...

Internal Apache request to PHP script overhead

I have a PHP page that gets its content by making an HTTP request to another site on the same server, using file_get_contents. Both sites run in Apache 2 which calls PHP using suPHP (which is FastCGI, right?) How significant is the overhead of this call? Does Apache do a lot of processing before sending a request to PHP? An alternative...

memory overhead of pointers in c/c++

I'm on a 64bit platform, so all memory adrs are 8 bytes. So to get an estimate of the memory usage of an array, should I add 8 bytes to the sizeof(DATATYPE) for each entry in the array. Example: short unsigned int *ary = new short unsigned int[1000000]; //length 1mio //sizeof(short unsinged int) = 2bytes //sizeof(short unsinged int*)...

Performance cost of coding "exception driven development" in Java?

Are there are any performance cost by creating, throwing and catching exceptions in Java? I am planing to add 'exception driven development' into a larger project. I would like to design my own exceptions and include them into my methods, forcing developers to catch and do appropriate work. For example, if you have a method to get a us...

How atomic *should* I make an Ajax form?

I have some web forms that I'm bringing over with AJAX, and as I was dealing with the database on the back end, I thought that it might be easier to just handle each input on the form atomically with AJAX, saving the form in 'real time' as the user edits it. The forms are ~20 fields of administrative settings. Would this create massive...

Java Memory Overhead

Hello, I would like to ask about Memory Overhead in java, I have a large ArrayList (61,770 items), and trying to calculate the amount of memory taken by each item (counting the object and its ArrayList entry), by profiling the app i get that after all the data is loaded, the heap takes ~ 25Mb. when the ArrayList has only 2 items the heap...

Is it a good practice to pass struct object as parameter to a function in c++?

I tried an example live below: typedef struct point { int x; int y; } point; void cp(point p) { cout<<p.x<<endl; cout<<p.y<<endl; } int main() { point p1; p1.x=1; p1.y=2; cp(p1); } The result thats printed out is: 1 2 which is what I expected. My que...

NSKeyedArchiver on NSArray has large size overhead

I'm using NSKeyedArchiver in Mac OS X program which generates data for iPhone application. I found out that by default, resulting archives are much bigger than I expected. Example: NSMutableArray * ar = [NSMutableArray arrayWithCapacity:10]; for (int i = 0; i < 100000; i++) { NSString * s = [NSString stringWithFormat:@"item%06d", i...

Performance Overhead of Perf Event Subsystem in Linux Kernel

Performance counters for Linux are a new kernel-based subsystem that provide a framework for all things performance analysis. It covers hardware level (CPU/PMU, Performance Monitoring Unit) features and software features (software counters, tracepoints) as well. Since 2.6.33, the kernel provide 'perf_event_create_kernel_counter' kernel ...

Bigger threadpool or additional ExecutorService when new kind of thread will run?

Hi, I have a question that is related to possible overhead of ExecutorServices in Java. The present implementation has ExecutorService A with a capacity of 5 threads. It runs threads of type A. type A threads do some database reading and writing. Now, a thread of type B will run after some threads of type A has finished. The num...