Performance of the structure type table

Example: // Potentially large struct. struct Foo { public int A; public int B; // etc. } Foo[] arr = new Foo[100]; If Foo is a 100 byte structure, how many bytes will be copied in memory during execution of the following statement: int x = arr[0].A T

How to speed up the execution of a long-time calculation

I'm trying to write a function to convert an image into characters and colors for the windows console. At the moment the calculation takes about 13 seconds with a 700x700 pixel image but that time is undesirable especially when I plan on making the f

Peewee with bulk insert is very slow in sqlite db

I'm trying to do a large scale bulk insert into a sqlite database with peewee. I'm using atomic but the performance is still terrible. I'm inserting the rows in blocks of ~ 2500 rows, and due to the SQL_MAX_VARIABLE_NUMBER I'm inserting about 200 of

What is the equivalent of a heap dump in Oracle

Doing some reading about Oracle database and I'm learning about Shared Pools. I used this as my main reference: After reading this one thing I'm still not clear on is how we can

the octave is slow; suggestions

Have run the following code in both Octave 4.0.0 and MATLAB 2014. Time difference is silly, i.e. more than two orders of magnitude. Running on Windows laptop. What can be done to improve Octave computational speed? startTime = cputime; iter = 1; % it

Should I "new" an object inside or outside a loop?

Comparing test1() and test2() in the following code: class Test{ //max value is a large number int max_value = 100*1000; public void test1(){ for(int i=0; i<max_value;){ StringBuilder builder = new StringBuilder(); builder.append("String value&quo

Java Infinite Loop Performance

I have a Thread that only has to work when a certain circumstance comes in. Otherwise it just iterates over an empty infinite loop: public void run() { while(true) { if(ball != null) { // do some Calculations } } } Does it affect the performance when

Number of Linq vs IList count

If I have the following IEnumerable list which comes from some repository. IEnumerable<SomeObject> items = _someRepo.GetAll(); What is faster: items.Count(); // Using Linq on the IEnumerable interface. or List<SomeObject> temp = items.ToList&l

Java Spring Async Performance

We have a service that writes some data to a file. New file per request. For example: GET{data} This request will create new file /var/files/{random-name}.txt. Service is built with @Async to avoid clients to wait

Performance InnoDB

I know there are plenty of information on this topic, but I think I've tried everything I can, and don't know any new ideas (if any?) about increasing my MySQL database performance. Situation: I use eTesting platform (taotesting if anybody knows it).

Can we call the getter of a super class to reduce efficiency?

I have two classes : abstract class Employee{ protected int id; public int getId(){ return id; } } class Manager extends Employee{ } In the course of the execution of the rest of my application I create lots of employee objects and call their getId()

Sphinx gets millions of results

I use MySQL + Sphinx to store many millions rows of data. We have website to view all information from our database. For example, movie titles (100,000,000 rows). I need to view ALL of them on our website, 100 titles per page. Also, i need view them

Solr performance with multiple fields

I have to index around 10 million documents in solr for full text search. Each of these documents have around 25 additional metadata fields attached to them. Each of the metadata fields individually are small (upto 64 characters). Common queries woul

JQuery applies standard practice

When using a JQuery plugin, is it a good idea to cut it down in order to only leave the parts necessary for your application or is it better to leave it as it is? In a related question, is there an impact in performance having to load the entire plug

Large PNG images in the Dev iPhone application

I have a question about the png images I am using in my iPhone app. I have a lot of large images for different views, they are compressed but I was wondering if that would slow down the application at all. Like in initial loading time and loading dif

Minimize jQuery instance vs create more instances

I started a series of posts on javascript / jQuery optimization and stumbled upon this interesting result. Why is it that minimizing jQuery objects (by searching from a cached jQuery collection) can be slower then creating more instances of jQuery ob

column json vs several columns

i don't even know if calling it serialized column is right, but i'm going to explain myself, for example, i have a table for users, i want to store the users phone numbers(cellphone, home, office, etc), so, i was thinkin' to make a column for each nu

Does a servlet-based stack have significant overhead?

I don't know if it's simply because page-loads take a little time, or the way servlets have an abstraction framework above the 'bare metal' of HTTP, or just because of the "Enterprise" in Jave-EE, but in my head I have the notion that a servlet-

FacesMessages and rich: effect?

I'd like to be able to make an Ajax call using JSF/Seam/RichFaces and have the page update with the relevant h:messages component. That works with no problem. I'm able to perform the appropriate reRender. However, I'd also like to be able to make use

Performance Issue with SQL Server Stored Procedure

I used the ANTS profiler to identify the remaining bottleneck in my C# application: the SQL Server stored procedure. I am using SQL Server 2008. Can anybody here help me increase performance, or give me pointers as to what I can do to make it better

C #: Create CPU usage at a custom percentage

I'm looking to test system responsiveness etc. on a few machines under certain CPU usage conditions. Unfortunately I can only create ~100% usage (infinite loop) or not enough CPU usage (I'm using C#). Is there any way, in rough approximation, as othe

How to improve the quality of DrawDIB?

I am coding in c++, gdi I use stretchDIBits to draw Images to dc. ::SetStretchBltMode(hDC, HALFTONE); ::StretchDIBits( hDC, des.left,,des.right - des.left,des.bottom -, 0, 0, img.getWidth(), img.getHeight(), (img.accessPixels()), (img.

Boost :: multi_array performance issue

I am trying to compare the performance of boost::multi_array to native dynamically allocated arrays, with the following test program: #include <windows.h> #define _SCL_SECURE_NO_WARNINGS #define BOOST_DISABLE_ASSERTS #include <boost/multi_array.h

What are the attributes that enable .Net performance?

I am looking for attributes I can use to ensure the best runtime performance for my .Net application by giving hints to the loader, JIT compiler or ngen. For example we have DebuggableAttribute which should be set to not debug and not disable optimiz