Benchmarking hash table implementations

Originally posted on lonewolfer:

A post after a very long pause, about something completely different.

I will do a fairly brief and naïve benchmark of different hash table implementations. Doing a complete in depth benchmark on this topic is difficult since the behaviour and target use cases can vary greatly and different implementations do different trade-offs.

Hopefully the results will still be of some interest and significance. The reason for doing this will hopefully be more clear later on.

Associative arrays/dictionaries/maps/tables, whatever you wish to call them, are one of the most common and important container types. Most often they are implemented using hash tables for the obvious practical reason that the cost of operations like insert/lookup/delete are amortized constant, or on average O(1).

Most languages typically have built-in or standardized ways to support this. Surprisingly, perhaps, this is not the case with the “#1″ programming language, C. One of the reasons being that most…

View original 582 more words

The mystery of the Zombie RAM

Originally posted on

It all started one bright morning when I wondered: Can the RAM memory on an AVR chip continue to store data after power is removed? If it can hold the data even just for a brief moment, then that could be very useful in a project I am working on.

To test it, I wrote a tiny little program that would check for a a special value in RAM (a “magic cookie”) upon power up and light an LED if it saw the right value…

#include <avr/io.h>

#define MAGIC_COOKIE 0xee00ff55UL // Nice cookie to exercise bits

unsigned long ram_cookie;

void init0 (void) __attribute__ ((naked)) __attribute__ ((section (".init0")));

// This code will be run immedeately on reset, before any initilization or main()

void init0(void) {

DDRD = _BV(0); // Enable output on LED on pin 19

if (ram_cookie==MAGIC_COOKIE) { // Is the cookie there?

PORTD = _BV(0); // Light the LED!

View original 1,194 more words

Sobre el software libre y los entornos de producción en la electrónica…

Una idea general

Hace algunos años comencé a trabajar  en la construcción de proyectos electrónicos simples y no realmente para la industria. Motivado por los trabajos que ser requerían en la Universidad, un sueño que durante años perseguí de a poco se iba convirtiendo en realidad. Pudiendo compatibilizar mi sueño, mi hobby con la carrera comencé, hace casi un par de años que vivo de esto. Ahora quiero hablarles sobre el papel del software libre en mis proyectos destinados para la industria.

Continue reading