The code looks nice, but is see a few issues in it which I'll try to list here: - This is supposedly a header file. However, you've included in here both declarations and definitions of your functions and structures. Normally, only the structures and the declarations of the functions should go into the header file, while the definitions of the functions should go into a source file (a .c). The way it is done at the moment, if you try to include your file into two different compilations units, you will have a problem at link time for multiple definitions of the functions... - Normally, you define first your structures and typedef them after (or at the same time) but not before. Actually, I'm not sure the way you did it is compliant with the C standard (I could e wrong here). - You have a major issue in the code for with the way you allocate your structures: by using a static variable into the "constructors" and returning a pointer to it, you actually reuse again again and again the same address from one call to the next. This means that all you neurons are actually the same one, and that you loose the references to all the allocated memories but the last ones... Just allocate a new neuron per call and return a pointer to it (idem for all the other structures). - Performance-wise, it is hard to tell anything. Nothing strikes me as problematic, but the good way of doing is to profile your code and possibly optimize the hottest parts when identified.