Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance Improvements #18

Draft
wants to merge 21 commits into
base: master
Choose a base branch
from
Draft

Performance Improvements #18

wants to merge 21 commits into from

Conversation

heywhy
Copy link
Owner

@heywhy heywhy commented Mar 1, 2022

Overview

Currently, building an inverted index happens immediately after the documents have been indexed. But this comes with a problem, as the extracted terms from documents increase the computation time increases so the best way to handle this is to defer the computation to a scheduler.

In this PR are contained an immediate and async scheduler, as the names imply, the immediate scheduler handles its tasks immediately while the async scheduler defers the task.

TODO

  • Add error handling
  • Provide the ability to configure what action should take place when a document conflict occurs
  • Update affected tests
  • Expose a function to calculate an index documents size
  • GitHub Actions are all passing

@coveralls

This comment was marked as outdated.

@codecov
Copy link

codecov bot commented Mar 5, 2022

Codecov Report

Merging #18 (1b29fdf) into master (0fcb8de) will decrease coverage by 0.46%.
The diff coverage is 90.00%.

@@            Coverage Diff             @@
##           master      #18      +/-   ##
==========================================
- Coverage   91.80%   91.33%   -0.47%     
==========================================
  Files          27       31       +4     
  Lines         622      658      +36     
==========================================
+ Hits          571      601      +30     
- Misses         51       57       +6     
Impacted Files Coverage Δ
lib/elasticlunr/application.ex 83.33% <ø> (ø)
lib/elasticlunr/logger.ex 50.00% <50.00%> (ø)
lib/elasticlunr/storage/disk.ex 93.54% <50.00%> (ø)
lib/elasticlunr/core/field.ex 95.90% <81.81%> (-3.25%) ⬇️
lib/elasticlunr/scheduler/async.ex 94.73% <94.73%> (ø)
lib/elasticlunr/core/index.ex 77.50% <100.00%> (+1.50%) ⬆️
lib/elasticlunr/deserializer.ex 90.00% <100.00%> (ø)
lib/elasticlunr/protocol_implementations.ex 91.30% <100.00%> (+0.39%) ⬆️
lib/elasticlunr/scheduler.ex 100.00% <100.00%> (ø)
lib/elasticlunr/scheduler/immediate.ex 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0fcb8de...1b29fdf. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants