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

Port feed reader to Rust #894

Draft
wants to merge 32 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
e78d920
Backoff RSS requests if a url repeatedly fails.
Half-Shot Feb 6, 2024
f5568e2
Increase max backoff time to a day
Half-Shot Feb 6, 2024
2ee5012
Add backoff for failing feeds.
Half-Shot Feb 6, 2024
b7cd4fe
Remove unused finally
Half-Shot Feb 6, 2024
18429ce
Add this.feedLastBackoff
Half-Shot Feb 6, 2024
80d4b9b
Rewrite in rust.
Half-Shot Feb 6, 2024
eff30b8
linting
Half-Shot Feb 6, 2024
517d044
pop
Half-Shot Feb 6, 2024
ea7af88
Optimise backoff function further
Half-Shot Feb 6, 2024
965c30b
Drop only!
Half-Shot Feb 6, 2024
e3d085e
fix test
Half-Shot Feb 6, 2024
4274eb4
lint
Half-Shot Feb 6, 2024
64ab808
lint further
Half-Shot Feb 6, 2024
9232213
Better comments
Half-Shot Feb 6, 2024
d0846b1
Fix urls calculation
Half-Shot Feb 7, 2024
92842fd
Merge remote-tracking branch 'origin/main' into hs/add-sensible-rss-b…
Half-Shot Feb 7, 2024
5659d88
Remove testing URL
Half-Shot Feb 7, 2024
e6ddcb6
Add some variance to speed up while loop
Half-Shot Feb 7, 2024
4838ba1
correct comment
Half-Shot Feb 7, 2024
1614a2a
Follow the advice and use a VecDeque as it's slightly faster.
Half-Shot Feb 7, 2024
958bdcb
Vastly better shuffle method
Half-Shot Feb 7, 2024
bec670f
Speed up checking for previous guids.
Half-Shot Feb 7, 2024
be4a468
fix hasher function
Half-Shot Feb 7, 2024
bd0822e
lint
Half-Shot Feb 7, 2024
db23748
Content doesn't need to be calculated twice.
Half-Shot Feb 7, 2024
605139f
Slightly more efficient iteration
Half-Shot Feb 7, 2024
ffd3881
Improve performance of backoff insertion
Half-Shot Feb 7, 2024
6649143
Configure feed reader
Half-Shot Feb 8, 2024
149ca51
lint
Half-Shot Feb 8, 2024
5b87dc0
Start porting the reader to Rust.
Half-Shot Feb 8, 2024
4b626ee
Try to implement a trait for storage.
Half-Shot Feb 9, 2024
bf88aab
More cleanup
Half-Shot Feb 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Vastly better shuffle method
  • Loading branch information
Half-Shot committed Feb 7, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 958bdcb26d6bbffb704aa7ad45bdaf5f6f2cc1f0
10 changes: 1 addition & 9 deletions src/util/mod.rs
Original file line number Diff line number Diff line change
@@ -97,14 +97,6 @@ impl QueueWithBackoff {
#[napi]
pub fn shuffle(&mut self) {
let mut rng = rand::thread_rng();
let old_queue = self.queue.clone();
self.queue.clear();
for item in old_queue {
if rng.gen_bool(0.5) {
self.queue.push_front(item);
} else {
self.queue.push_back(item);
}
}
self.queue.make_contiguous().shuffle(&mut rng);
}
}
Loading