Faster method for loading a hash table I'm looking to make my code faster for loading a hash table.  Any pointers would be appreciated.  Below are my includes, the node def and the loading code.

The dictionary loaded could be any *.txt file.  Its pre processed to contains just lower case words sans punctuation.

#include &lt;stdbool.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;stdio.h&gt;
#include &lt;string.h&gt;
#include &lt;ctype.h&gt;
#include "dictionary.h"

// define hash table structure 
typedef struct node
{
    char word[LENGTH + 1];
    struct node* next;
}
node;

bool load(const char* dictionary)
{

    // open dictionary and check for NULL
    FILE* fpdict = fopen(dictionary, "r");

    if (fpdict == NULL)
    {
        printf("Could not open %s.\n", dictionary);
        unload();
        return false;    
    }

    // read in txt file
    else
    {
        node* new_node = malloc(sizeof(node));
        for ( ; fscanf(fpdict, "%s", new_node-&gt;word) != EOF;
            new_node = malloc(sizeof(node)) )     
        { 
            // call hash function to get key
            key = hash(new_node-&gt;word, strlen(new_node-&gt;word), TABLESIZE);

            // check if hashtable key is NULL
            if (hashtable[key] == NULL)
            {    
                hashtable[key] = new_node;
                new_node-&gt;next = NULL;
            }

            // if linked list exists, insert it in order 
            else if (hashtable[key] != NULL)
            {
                // point to first hashtable entry
                node* head = hashtable[key];
                // set crawler to head
                node* crawler = head;
                // check where to insert

                // insert word at end and set pointer to NULL
                while (crawler-&gt;next != NULL)
                {
                    crawler = crawler-&gt;next;
                }
                new_node-&gt;next = NULL;
                crawler-&gt;next = new_node;

            }
            wordCount += 1;
        }
        fclose(fpdict);
        free(new_node);
        return true;           
    }    

    return false;
}
An ultimate speedup is achieved by preprocessing the dictionary one step further, into the binary format. Group the words of the same hashcode together, and prepare a TOC as an array of file offsets of each such group at the beginning of the file. This way the dictionary loads in a single fread() (you may also want to account for endianness with bit more sophisticated format).

I also found strange that you add nodes at the end of the list. Unless you have a very strong reason of doing so, crawling lists is a pure waste of time. Inserting node at the head unconditionally may - or may not - gain some performance, depending of the quality of the hash.

That said, I may only reiterate on the @Edward comment: profile the code.