performance-comparison

Which is faster in SQL, While loop, Recursive Stored proc, or Cursor?

Which is faster in SQL, While loop, Recursive Stored proc, or Cursor? I want to optimize the performance in a couple of spots in a stored procedure. The code I'm optimizing formats some strings for output to a file. ...

Reading images (jpeg) files from SD Cards Vs SQLLite DB

Does anyone have any idea (numbers?) that shows the difference between reading image files from a SQLLite database vs reading it directly from the file system in a SD card. Which one is faster ? Thanks. ...

Is there any difference in performance between these two instructions?

i have the following criteria specification and wanted to know if there is any difference in the performance or the memory usage of them. 1st way: criteria.add(Restrictions.eq("case.estadoOperativo", Caso.EstadoOperativo.COMPLETADO)) .add(Restrictions.eq("case.estadoAdministrativo", Caso.EstadoAdministrativo.TARIFICADO)); 2nd ...

when is parallelizing disk i/o worth the effort?

Based on your experience, have you gained performance boost from parallelizing disk I/O? I/O reads in particular In my case, I though having RAID 0 drives would allow to run at least two reads concurrently, but it still is slower than the serial approach. Would you ever go for concurrent I/O reads? Why? ...

What is the difference between realpath() and is_dir() in php?

What is the difference between realpath($path) and is_dir($path)? I know realpath follows symbolic links, but is there a performance difference between the two? ...

Bulk insert efficiency in NoSQL databases

I am developing a service that needs to perform bulk insert of tens of thousands of rows/items/objects at a time, about 20 times per second. (The NoSQL storage can be sharded, so inserts can work in parallel. The sharding strategy, and sharding in general, do not matter for this discussion.) The question is: which NoSQL products in yo...

Does having large number of properties in an Entity effect datastore read/write performance?

I have couple of entities with properties numbering in the range of 40 - 50. All these properties are unindexed. These entities are a part of a larger entitygroup tree structure, and are always retrieved by using their key. None of the properties (except the key property) are indexed. I am using Objectify to work with entities on BigTabl...

Higher level languages with C functions

Maybe this has been asked before, but I couldn't find it. My question is simple: Does it make sense to write an application in higher level languages (Java, C#, Python) and time/performance-critical functions in C? Or at this point unless you do very low level OS/game/sensor programming it is all the same to have a full, say, Java applic...

Fastest way to remove first char in a string

Say we have the following string string data= "/temp string"; If we want to remove the first character / we can do by alot of ways such as : data.Remove(0,1); data.TrimStart('/'); data.Substring(1); But .. really I don't know which one have the best algorithm and doing that faster .. Is there a one that is the best or all are the...

Instantiation in a loop: Verbosity vs. Performance

So in the following bit of code, I really like the verbosity of scenario one, but I would like to know how big of a performance hit this takes when compared to scenario two. Is instantiation in the loop a big deal? Is the syntactic benefit (which I like, some might not even agree with it being verbose or optimal) worth said performance...

What is memoization good for and is it really all that helpful?

There are a few automatic memoization libraries available on the internet for various different languages; but without knowing what they are for, where to use them, and how they work, it can be difficult to see their value. What are some convincing arguments for using memoization, and what problem domain does memoization especially shine...

Overhead of retrieval of an object compared to storing in local

Suppose you have a private static method called Inst() which allows the class to retrieve the single instance of itself in the application in its static methods. Maybe Inst() is defined something like.. return App::GetApp()->CurrentState()->MyClass(); // Inst returns a reference Compare this... // I prefer this Inst().DoThis(); Inst(...

What is better in performance: Jetty or Tomcat for production needs?

Hi all im planning to use java/jsp for web application installed on virtual web hosting space i know tomcat very well but i keep reading about jetty that is small and fast what to you think from your experience about the two ? what is better ? i will use Nginx for static pages . ...

Performance of very big classes

I have a class called "simulation" and a method for solving simulation. class sim { void Step() { } other methods (20+)... } Sim class is only instantiated once during the program. Step method is called in the order of millions during the program. Step method uses a lot of local variables (100+). None of those local...

Does growing files on Linux cost anything?

Is there any noticeable difference in speed between these 2 scenarios? Scenario 1: I have a file of size 1024 bytes filled with 0s for every byte. I open the file and write 1024 bytes of 1s with fwrite. Scenario 2: I have a file of size 512 bytes filled with 0s for every byte. I open the file and write 1024 bytes of 1s with fwrite. Ob...

Nested loop comparison in Python,Java and C

The following code in python takes very long to run. (I couldn't wait until the program ended, though my friend told me for him it took 20 minutes.) But the equivalent code in Java runs in approximately 8 seconds and in C it takes 45 seconds. I expected Python to be slow but not this much, and in case of C which I expected to be faste...

google analytics in intranet site

We have multiple e-commerce website handled by multiple managers in various locations. Each website has google analytics present in it and each of it is assigned to its own manager. We are planning to have an intranet website, where all these e-commerce websites will be present at one location and the performance of these sites need to ...

Scala Performance: imperative vs functional style

I'm new to Scala and was just reading Scala By Example. In chapter 2, the author has 2 different versions of Quicksort. One is imperative style: def sort(xs: Array[Int]) { def swap(i: Int, j: Int) { val t = xs(i); xs(i) = xs(j); xs(j) = t } def sort1(l: Int, r: Int) { val pivot = xs((l + r) / 2) var ...

Are there benchmarks on how bad the performance regression in Perl 5.10.0 was?

I am working in a high availability environment at the moment, so performance is a bit of an issue for this company. I found out today they are running Perl 5.10.0, which according to perl5101delta has a performance regression in list assignments. Now since we're on Debian, updating isn't exactly easy, so I am looking for statistics to m...

LINQ to SQL / LINQ to Collections Performance Question

There's two options for dealing with LINQ to Collections that are populated with SQL (I'm using an Oracle provider, so no LINQ without an ORM). 1) Do one big SQL query, dump the results into some sort of collection and do LINQ queries on the collection, so you have one big draw on the database, but not much slowdown after that. 2) Do s...