fastest MD5 Implementation in JavaScript

I’ve heard Joseph’s Myers implementation is quite fast. Additionally, he has a lengthy article on Javascript optimization describing what he learned while writing his implementation. It’s a good read for anyone interested in performant javascript. http://www.webreference.com/programming/javascript/jkm3/ His MD5 implementation can be found here

LINQ: Not Any vs All Don’t

Implementation of All according to ILSpy (as in I actually went and looked, rather than the “well, that method works a bit like …” I might do if we were discussing the theory rather than the impact). public static bool All<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate) { if (source == null) { throw Error.ArgumentNull(“source”); } … Read more

Is it safe to shallow clone with –depth 1, create commits, and pull updates again?

Note that Git 1.9/2.0 (Q1 2014) has removed that limitation. See commit 82fba2b, from Nguyễn Thái Ngọc Duy (pclouds): Now that git supports data transfer from or to a shallow clone, these limitations are not true anymore. The documentation now reads: –depth <depth>:: Create a ‘shallow’ clone with a history truncated to the specified number … Read more

SQL Server: Query fast, but slow from procedure

I had the same problem as the original poster but the quoted answer did not solve the problem for me. The query still ran really slow from a stored procedure. I found another answer here “Parameter Sniffing”, Thanks Omnibuzz. Boils down to using “local Variables” in your stored procedure queries, but read the original for … Read more

Why is Haskell (GHC) so darn fast?

I agree with Dietrich Epp: it’s a combination of several things that make GHC fast. First and foremost, Haskell is very high-level. This enables the compiler to perform aggressive optimisations without breaking your code. Think about SQL. Now, when I write a SELECT statement, it might look like an imperative loop, but it isn’t. It … Read more

Difference between declaring variables before or in loop?

Which is better, a or b? From a performance perspective, you’d have to measure it. (And in my opinion, if you can measure a difference, the compiler isn’t very good). From a maintenance perspective, b is better. Declare and initialize variables in the same place, in the narrowest scope possible. Don’t leave a gaping hole … Read more