• When you start emacs from a shell, emacs inherits shell’s environment variables. (true on Windows, Mac, Linux)
  • On Windows, when you start emacs from GUI, emacs also inherit environment variables, from the Registry.
  • On Mac OS X, when you start emacs from GUI, emacs does not inherit environment variables from your shell, but does inherit the system-wide environment variables from 〔~/.MacOSX/environment.plist〕.
  • On Mac OS X, you can start GUI emacs from shell, like this: nohup /Applications/Emacs.app/Contents/MacOS/Emacs &. This way, it’ll inherit shell’s environment variables.

Tags: Emacs


Tags: shell

The following design document describes the the new garbage collector (GC) to be introduced with LuaJIT 2.1. This document is very much a work in progress right now. Anything may change for the actual implementation. No code is available, yet.

The purpose of this document is to gather early feedback on all design aspects and to present the planned work to sponsors.

Note to potential sponsors: This feature is in need of sponsorship! Work on LuaJIT 2.1 probably won’t start until I’m able to get full covenants for this and other planned new features. Please refer to the LuaJIT Sponsorship Page. Thank you!

You probably need to have at least some background knowledge on garbage collection algorithms to fully enjoy the following document. There are plenty of books, research papers and other freely available online resources for this. A good start would be the Wikipedia article on Garbage Collection.

Tags: GC Lua

The environment variable of grep.

Tags: grep

Don’t use awk!


  • The task at hand is primarily the parsing of files or piped streams.
  • You’re willing to ignore OOP and Structured Programming principles.
  • You’re willing to learn the awk way of doing things.
  • The program is not expected to grow larger than 400 lines.

Tags: AWK

  1. Do not use locks in the main transaction flow because they cause context switches, and therefore latency and unpredictable jitter.
  2. Never have more threads that need to run than you have cores available.
  3. Set affinity of threads to cores, or at least sockets, to avoid cache pollution by avoiding migration.  This is particularly important when on a server class machine having multiple sockets because of the NUMA effect.
  4. Ensure uncontested access to any resource respecting the Single Writer Principle so that the likes of biased locking can be your friend.
  5. Keep call stacks reasonably small.  Still more work to do here.  If you are crazy enough to use Spring, then check out your call stacks to see what I mean!  The garbage collector has to walk them finding reachable objects.
  6. Do not use finalizers.
  7. Keep garbage generation to modest levels.  This applies to most JVMs but is likely not an issue for Zing.
  8. Ensure no disk IO on the main flow.
  9. Do a proper warm-up before beginning to measure.
  10. Do all the appropriate OS tunings for low-latency systems that are way beyond this blog.  For example turn off C-States power management in the BIOS and watch out for RHEL 6 as it turns it back on without telling you!
  11. Macro-benchmarking is much more valuable than micro-benchmarking.
  12. Amazing results are achieved by truly agile companies, staffed by talented individuals, who are empowered to make things happen. Make sh*t happen is more important than following a process.

Tags: Scalabillity

The placement new in C++. It can be used in many embedded systems.

Tags: C++

The following is a special collection of freeware tools for system administration written in Perl. They cover advanced topics for the experienced admin, and are a valuable addition to a senior admin’s collection or those wishing to be a senior admin. Most are related to performance or fault prevention.

Note: These are freeware programs and have nothing at all to do with the respective Operating System vendors.

Tags: Unix

Compares the four major APIs for browser-side storage and explains how to balance performance, data size, and browser support.

String matching algorithm named BWT.

Tags: Algorithm