salihtuc / word2vec

Automatically exported from code.google.com/p/word2vec
Apache License 2.0
0 stars 0 forks source link

distance.c - fread'ing all vector floats at once boosts loading speed by ~3x... #34

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
replacing:
    for (a = 0; a < size; a++) fread(&M[a + b * size], sizeof(float), 1, f);

with:
    fread(&M[b * size], sizeof(float), size, f);

Greatly increases loading speed.

Original issue reported on code.google.com by chad.p...@gmail.com on 21 Jul 2015 at 5:01