Browse Source

Update readme and add benchmark

master
Daniel 11 months ago
parent
commit
0405c3d35d
3 changed files with 11 additions and 3 deletions
  1. +1
    -1
      Makefile
  2. +3
    -1
      README.md
  3. +7
    -1
      test.c

+ 1
- 1
Makefile View File

@@ -1,5 +1,5 @@
t ?= web
dir ?= ..
dir ?= ../

default:
@$(CC) -I$(dir) $(dir)/biblec/biblec.c bsearch.c test.c -o test.out


+ 3
- 1
README.md View File

@@ -1,4 +1,6 @@
# BibleSearch
An efficient algorithm for searching Bible text.

To see the old JS/Python version, see: https://code.heb12.com/heb12/biblesearch/src/commit/e4dd8b334988f3f8049a03dc2fb317b49f0eb938
In `legacy/`, there is an older Python-based legacy version.
It was designed for server usage and is fairly slow due to
being written in Python.

+ 7
- 1
test.c View File

@@ -1,8 +1,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

#include <biblec/main.h>
#include <biblec/biblec.h>

#include "bsearch.h"

@@ -18,6 +19,8 @@ int main() {
return -1;
}

clock_t start = clock();

char mySearch[][BSEARCH_MAX_WORD] = {
"created",
"beginning"
@@ -43,6 +46,9 @@ int main() {
printf("%d\t%s\n", result[i], buffer);
}

double elapsed = (double)(clock() - start) / CLOCKS_PER_SEC;
printf("Done in %f seconds.\n", elapsed);

free(result);
return 0;
}

Loading…
Cancel
Save