Performance fixture: real-world Rust file pair from tauri-apps/tauri (examples/api/src-tauri/build.rs, commit cde0ff7798a46712f69b34aab952209f45500fe9, a later commit on the same file as medium-tauri-api-build-1) that takes diff_code roughly 670ms despite a combined AST size of only 909 nodes. Captured via research/diff_pairs_benchmark_rust.csv; useful for regression-testing and profiling diff_code's worst-case behavior on small/medium real-world inputs.

Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–22 unchanged (22 lines)
23 .expect("failed to run tauri-build");
24
25 // workaround needed to prevent `STATUS_ENTRYPOINT_NOT_FOUND` error in tests
26 // see https://github.com/tauri-apps/tauri/pull/4383#issuecomment-1212221864
27 let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap();
28 let target_env = std::env::var("CARGO_CFG_TARGET_ENV");
29 let is_tauri_workspace = std::env::var("__TAURI_WORKSPACE__").map_or(false, |v| v == "true");
30 if is_tauri_workspace && target_os == "windows" && Ok("msvc") == target_env.as_deref() {
31 embed_manifest_for_tests();
32 }
33}
34
35fn embed_manifest_for_tests() {
…lines 36–53 unchanged (18 lines)

After

…lines 1–22 unchanged (22 lines)
23 .expect("failed to run tauri-build");
24
25 // workaround needed to prevent `STATUS_ENTRYPOINT_NOT_FOUND` error in tests
26 // see https://github.com/tauri-apps/tauri/pull/4383#issuecomment-1212221864
27 let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap();
28 let target_env = std::env::var("CARGO_CFG_TARGET_ENV");
29 let is_tauri_workspace = std::env::var("__TAURI_WORKSPACE__").is_ok_and(|v| v == "true");
30 if is_tauri_workspace && target_os == "windows" && Ok("msvc") == target_env.as_deref() {
31 embed_manifest_for_tests();
32 }
33}
34
35fn embed_manifest_for_tests() {
…lines 36–53 unchanged (18 lines)

Before

source_file
line_comment
// "//"
line_comment
// "//"
line_comment
// "//"
use_declaration
use "use"
scoped_identifier
identifier "tauri_build"
:: "::"
identifier "WindowsAttributes"
; ";"
function_item
fn "fn"
identifier "main"
parameters
( "("
) ")"
block
{ "{"
expression_statement (+161 nodes collapsed)
line_comment
// "//"
line_comment
// "//"
let_declaration (+27 nodes collapsed)
let_declaration
let "let"
identifier "target_env"
= "="
call_expression
scoped_identifier
scoped_identifier
identifier "std"
:: "::"
identifier "env"
:: "::"
identifier "var"
arguments
( "("
string_literal
" "\""
string_content "CARGO_CFG_TARGET_ENV"
" "\""
) ")"
; ";"
let_declaration
let "let"
identifier "is_tauri_workspace"
= "="
call_expression
field_expression
call_expression
scoped_identifier
scoped_identifier
identifier "std"
:: "::"
identifier "env"
:: "::"
identifier "var"
arguments
( "("
string_literal
" "\""
string_content "__TAURI_WORKSPACE__"
" "\""
) ")"
. "."
field_identifier "map_or"
arguments
( "("
boolean_literal
false "false"
, ","
closure_expression
closure_parameters
| "|"
identifier "v"
| "|"
binary_expression
identifier "v"
== "=="
string_literal
" "\""
string_content "true"
" "\""
) ")"
; ";"
expression_statement (+44 nodes collapsed)
} "}"
function_item (+135 nodes collapsed)

After

source_file
line_comment
// "//"
line_comment
// "//"
line_comment
// "//"
use_declaration
use "use"
scoped_identifier
identifier "tauri_build"
:: "::"
identifier "WindowsAttributes"
; ";"
function_item
fn "fn"
identifier "main"
parameters
( "("
) ")"
block
{ "{"
expression_statement (+161 nodes collapsed)
line_comment
// "//"
line_comment
// "//"
let_declaration (+27 nodes collapsed)
let_declaration
let "let"
identifier "target_env"
= "="
call_expression
scoped_identifier
scoped_identifier
identifier "std"
:: "::"
identifier "env"
:: "::"
identifier "var"
arguments
( "("
string_literal
" "\""
string_content "CARGO_CFG_TARGET_ENV"
" "\""
) ")"
; ";"
let_declaration
let "let"
identifier "is_tauri_workspace"
= "="
call_expression
field_expression
call_expression
scoped_identifier
scoped_identifier
identifier "std"
:: "::"
identifier "env"
:: "::"
identifier "var"
arguments
( "("
string_literal
" "\""
string_content "__TAURI_WORKSPACE__"
" "\""
) ")"
. "."
field_identifier "is_ok_and"
arguments
( "("
closure_expression
closure_parameters
| "|"
identifier "v"
| "|"
binary_expression
identifier "v"
== "=="
string_literal
" "\""
string_content "true"
" "\""
) ")"
; ";"
expression_statement (+44 nodes collapsed)
} "}"
function_item (+135 nodes collapsed)