Use threads #4

Closed
opened 2021-05-25 19:34:48 +02:00 by tastytea · 1 comment
Owner

We should probably make use of threads where possible. It should be safe to use a separate thread for each file in the EPUB. Could be too much overhead though. Maybe it is better to use one thread per EPUB.

We should probably make use of threads where possible. It should be safe to use a separate thread for each file in the EPUB. Could be too much overhead though. Maybe it is better to use one thread per EPUB.
tastytea added the
enhancement
label 2021-05-25 19:34:48 +02:00
Author
Owner

I tested a bit with time ./build/src/epubgrep -EC2 'a' <files> > /dev/null. I made 2 passes each time and took the average.

  • 3 files:
    • Without threads: 10.7 seconds
    • With 1 thread per file: 7.2 seconds
  • 6 files:
    • Without threads: 42.2 seconds
    • With 1 thread per file: 29.1 seconds

That's 31-33% improvement.

With 6 books and time ./build/src/epubgrep -EiC2 '(aber|doch)' <files> > /dev/null, 4 passes:

  • Without threads: 0.8 seconds
  • With 1 thread per file: 0.6 seconds

25% improvement.

I tested a bit with `time ./build/src/epubgrep -EC2 'a' <files> > /dev/null`. I made 2 passes each time and took the average. * 3 files: * Without threads: 10.7 seconds * With 1 thread per file: 7.2 seconds * 6 files: * Without threads: 42.2 seconds * With 1 thread per file: 29.1 seconds That's 31-33% improvement. With 6 books and `time ./build/src/epubgrep -EiC2 '(aber|doch)' <files> > /dev/null`, 4 passes: * Without threads: 0.8 seconds * With 1 thread per file: 0.6 seconds 25% improvement.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: tastytea/epubgrep#4
No description provided.