Wide Finder: OCaml and JoCaml

Spent last night getting a crash course in using OCaml to do non-functional things (hash tables, file I/O, regular expressions) and the result is now up.

The JoCaml version does the file-partitioning trick used in the C++ implementation, with each finder workers being run inside a JoCaml channel; the channels share a single lock so they can update the hash table serially.

Interestingly, current implementation does not get a speed-up from the input file being cached (Ilmari’s wf.ml does). Will have to peruse his to see what’s slowing things down.

Lesson: not all techniques for processing a file line-wise are equally good!


One response to “Wide Finder: OCaml and JoCaml

  1. Problem:

    sca12-3200a-40 ~/n2/code/> gmake
    #jocamlc -I +pcre pcre.cma unix.cma \
    #-o wide_finder wide_finder.ml -cclib -lunix
    jocamlopt -I +pcre pcre.cmxa \
    -o wide_finder wide_finder.ml -cclib -lunix
    File “wide_finder.ml”, line 24, characters 0-9:
    Unbound module Pcre
    gmake: *** [wide_finder] Error 2