Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

`imara-diff` is a solid (imara in swahili) diff library for rust.
Solid refers to the fact that imara-diff provides very good runtime performance even
in pathologic cases so that your application never appears to freeze while waiting on a diff.
in pathological cases so that your application never appears to freeze while waiting on a diff.
The performance improvements are achieved using battle tested heuristics used in gnu-diff and git
that are known to perform well while still providing good results.

Expand Down Expand Up @@ -86,7 +86,7 @@ The sourcecode of the rust compiler, standard library and various related toolin
<img src='plots/rust_comparison.svg' width="700">
<img src='plots/rust_speedup.svg' width="700">

### VScode

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A well-trained Microsoft bot!

### VSCode

The sourcecode of the vscode editor.

Expand Down
4 changes: 2 additions & 2 deletions src/histogram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl Histogram {
&mut added[..lcs.after_start as usize],
);

// this is equivalent to (tail) recursion but implement as a loop for efficeny reasons
// this is equivalent to (tail) recursion but implement as a loop for efficiency reasons
let before_end = lcs.before_start + lcs.len;
before = &before[before_end as usize..];
removed = &mut removed[before_end as usize..];
Expand All @@ -108,7 +108,7 @@ impl Histogram {
None => {
// we are diffing two extremely large repetitive files
// this is a worst case for histogram diff with O(N^2) performance
// fallback to myers to maintain linear time complxity
// fallback to myers to maintain linear time complexity
myers::diff(before, after, removed, added, false);
return;
}
Expand Down
6 changes: 3 additions & 3 deletions src/intern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ impl<T: Eq + Hash> InternedInput<T> {
/// to allocate if their [`estimate_tokens`](TokenSource::estimate_tokens)
/// would represent an exact match of their actual tokens.
///
/// Useful for minimisation of allocation before calls to
/// Useful for minimization of allocation before calls to
/// [`update_before`](InternedInput::update_before) and
/// [`update_after`](InternedInput::update_after).
pub fn reserve_for_token_source<S: TokenSource<Token = T> + ?Sized>(
Expand All @@ -135,7 +135,7 @@ impl<T: Eq + Hash> InternedInput<T> {

/// replaces `self.before` with the interned Tokens yielded by `input`
/// Note that this does not erase any tokens from the interner and might therefore be considered
/// a memory leak. If this function is called often over a long_running process
/// a memory leak. If this function is called often over a long-running process
/// consider clearing the interner with [`clear`](Interner::clear).
pub fn update_before(&mut self, input: impl Iterator<Item = T>) {
self.before.clear();
Expand All @@ -145,7 +145,7 @@ impl<T: Eq + Hash> InternedInput<T> {

/// replaces `self.before` with the interned Tokens yielded by `input`
/// Note that this does not erase any tokens from the interner and might therefore be considered
/// a memory leak. If this function is called often over a long_running process
/// a memory leak. If this function is called often over a long-running process
/// consider clearing the interner with [`clear`](Interner::clear) or
/// [`erase_tokens_after`](Interner::erase_tokens_after).
pub fn update_after(&mut self, input: impl Iterator<Item = T>) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
//! * The **Histogram** algorithm which is a variant of the patience diff algorithm.
//!
//! Myers algorithm has been enhanced with preprocessing and multiple heuristics to ensure fast runtime in pathological
//! cases to avoid quadratic time complexity and closely matches the behaviour of gnu-diff and git.
//! cases to avoid quadratic time complexity and closely matches the behavior of gnu-diff and git.
//! The Histogram algorithm was originally ported from git but has been heavily optimized.
//! The **Histogram algorithm outperforms Myers diff** by 10% - 100% across a **wide variety of workloads**.
//!
Expand Down
4 changes: 2 additions & 2 deletions src/sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ impl Sink for () {
/// and counts the number of `removed` and `inserted` [tokens](crate::intern::Token).
pub struct Counter<T> {
/// Total number of recorded inserted [`tokens`](crate::intern::Token).
/// Computed by summing the lengths of the `after` subsequences pass to [`process_change`](crate::Sink::process_change).
/// Computed by summing the lengths of the `after` subsequences passed to [`process_change`](crate::Sink::process_change).
pub removals: u32,
/// Total number of recorded inserted [`tokens`](crate::intern::Token).
/// Computed by summing the lengths of the `after` subsequences pass to [`process_change`](crate::Sink::process_change).
/// Computed by summing the lengths of the `after` subsequences passed to [`process_change`](crate::Sink::process_change).
pub insertions: u32,
/// The [`Sink`] for which the counter records [`tokens`](crate::intern::Token).
/// All calls to [`process_change`](crate::Sink::process_change) are forwarded to the `sink` by the counter.
Expand Down