Any hard data on GC vs explicit memory management performance?

This turns into another flamewar with a lot of “my gut feeling”. Some hard data for a change (papers contain details, benchmarks, graphs, etc.): http://www.cs.umass.edu/~emery/pubs/04-17.pdf says: “Conclusion. The controversy over garbage collection’s performance impact has long overshadowed the software engineering benefi it provides.This paper introduces a tracing and simulation-based oracular memory manager. Using this framework, … Read more

Performance optimisations of x86-64 assembly – Alignment and branch prediction

Alignment optimisations 1. Use .p2align <abs-expr> <abs-expr> <abs-expr> instead of align. Grants fine-grained control using its 3 params param1 – Align to what boundary. param2 – Fill padding with what (zeroes or NOPs). param3 – Do NOT align if padding would exceed specified number of bytes. 2. Align the start of a frequently used code … Read more

Why isn’t pass struct by reference a common optimization?

Don’t forget that in C/C++ the compiler needs to be able to compile a call to a function based only on the function declaration. Given that callers might be using only that information, there’s no way for a compiler to compile the function to take advantage of the optimization you’re talking about. The caller can’t … Read more

Performance of Google’s Go?

Theoretical performance: The theoretical performance of pure Go programs is somewhere between C/C++ and Java. This assumes an advanced optimizing compiler and it also assumes the programmer takes advantage of all features of the language (be it C, C++, Java or Go) and refactors the code to fit the programming language. Practical performance (as of … Read more

Is performance reduced when executing loops whose uop count is not a multiple of processor width?

I did some investigation with Linux perf to help answer this on my Skylake i7-6700HQ box, and Haswell results have been kindly provided by another user. The analysis below applies to Skylake, but it is followed by a comparison versus Haswell. Other architectures may vary0, and to help sort it all out I welcome additional … Read more

Why do we use linear probing in hash tables when there is separate chaining linked with lists?

I’m surprised that you saw chained hashing to be faster than linear probing – in practice, linear probing is typically significantly faster than chaining. This is primarily due to locality of reference, since the accesses performed in linear probing tend to be closer in memory than the accesses performed in chained hashing. There are other … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)