Performance fixture: real-world Rust file pair from tauri-apps/tauri (crates/tauri-cli/src/mobile/ios/dev.rs, commit 0aa48fb9e4b9d7b5bf3522000a76ebc1836394ed) that takes diff_code roughly 13 seconds on a combined AST of 5162 nodes (~10.3KB per file) - the single slowest pair found across the entire benchmark sample. Captured via research/diff_pairs_benchmark_rust.csv; the top priority candidate for profiling diff_code's worst-case behavior.

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–164 unchanged (164 lines)
165 let app = get_app(MobileTarget::Ios, tauri_config_, &interface);
166 let (config, _metadata) = get_config(
167 &app,
168 tauri_config_,
169 dev_options.features.as_ref(),
170 &Default::default(),
171 );
172
173 (interface, config)
174 };
175
176 let tauri_path = tauri_dir();
177 set_current_dir(tauri_path).with_context(|| "failed to change current working directory")?;
…lines 178–333 unchanged (156 lines)

After

…lines 1–164 unchanged (164 lines)
165 let app = get_app(MobileTarget::Ios, tauri_config_, &interface);
166 let (config, _metadata) = get_config(
167 &app,
168 tauri_config_,
169 dev_options.features.as_ref(),
170 &Default::default(),
171 )?;
172
173 (interface, config)
174 };
175
176 let tauri_path = tauri_dir();
177 set_current_dir(tauri_path).with_context(|| "failed to change current working directory")?;
…lines 178–333 unchanged (156 lines)

Before

source_file
line_comment
// "//"
line_comment
// "//"
line_comment
// "//"
use_declaration (+33 nodes collapsed)
use_declaration (+84 nodes collapsed)
use_declaration
use "use"
scoped_use_list
identifier "clap"
:: "::"
use_list
{ "{"
identifier "ArgAction"
, ","
identifier "Parser"
} "}"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "anyhow"
:: "::"
identifier "Context"
; ";"
use_declaration (+49 nodes collapsed)
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "std"
:: "::"
identifier "env"
:: "::"
identifier "set_current_dir"
; ";"
const_item
const "const"
identifier "PHYSICAL_IPHONE_DEV_WARNING"
: ":"
reference_type
& "&"
primitive_type "str"
= "="
string_literal
" "\""
string_content "To develop on physical phones you need the `--host` option ("...
" "\""
; ";"
attribute_item
# "#"
[ "["
attribute
identifier "derive"
token_tree
( "("
identifier "Debug"
, ","
identifier "Clone"
, ","
identifier "Parser"
) ")"
] "]"
attribute_item (+22 nodes collapsed)
struct_item (+428 nodes collapsed)
impl_item (+137 nodes collapsed)
function_item (+86 nodes collapsed)
function_item
fn "fn"
identifier "run_command"
parameters
( "("
parameter
identifier "options"
: ":"
type_identifier "Options"
, ","
parameter
identifier "noise_level"
: ":"
type_identifier "NoiseLevel"
) ")"
-> "->"
generic_type
type_identifier "Result"
type_arguments
< "<"
unit_type
( "("
) ")"
> ">"
block
{ "{"
let_declaration
let "let"
identifier "env"
= "="
try_expression
call_expression
identifier "env"
arguments
( "("
) ")"
? "?"
; ";"
let_declaration (+88 nodes collapsed)
let_declaration (+23 nodes collapsed)
let_declaration (+65 nodes collapsed)
expression_statement (+21 nodes collapsed)
let_declaration (+73 nodes collapsed)
let_declaration
let "let"
tuple_pattern
( "("
identifier "interface"
, ","
identifier "config"
) ")"
= "="
block
{ "{"
let_declaration
let "let"
identifier "tauri_config_guard"
= "="
call_expression
field_expression
call_expression
field_expression
identifier "tauri_config"
. "."
field_identifier "lock"
arguments
( "("
) ")"
. "."
field_identifier "unwrap"
arguments
( "("
) ")"
; ";"
let_declaration
let "let"
identifier "tauri_config_"
= "="
call_expression
field_expression
call_expression
field_expression
identifier "tauri_config_guard"
. "."
field_identifier "as_ref"
arguments
( "("
) ")"
. "."
field_identifier "unwrap"
arguments
( "("
) ")"
; ";"
let_declaration (+23 nodes collapsed)
let_declaration
let "let"
identifier "app"
= "="
call_expression
identifier "get_app"
arguments
( "("
scoped_identifier
identifier "MobileTarget"
:: "::"
identifier "Ios"
, ","
identifier "tauri_config_"
, ","
reference_expression
& "&"
identifier "interface"
) ")"
; ";"
let_declaration
let "let"
tuple_pattern
( "("
identifier "config"
, ","
identifier "_metadata"
) ")"
= "="
call_expression (+34 nodes collapsed)
; ";"
tuple_expression
( "("
identifier "interface"
, ","
identifier "config"
) ")"
} "}"
; ";"
let_declaration
let "let"
identifier "tauri_path"
= "="
call_expression
identifier "tauri_dir"
arguments
( "("
) ")"
; ";"
expression_statement (+25 nodes collapsed)
expression_statement (+36 nodes collapsed)
expression_statement (+42 nodes collapsed)
let_declaration (+39 nodes collapsed)
let_declaration (+62 nodes collapsed)
expression_statement
try_expression
call_expression
field_expression
identifier "merged_info_plist"
. "."
field_identifier "to_file_xml"
arguments
( "("
reference_expression
& "&"
identifier "info_plist_path"
) ")"
? "?"
; ";"
let_declaration
let "let"
mutable_specifier "mut"
identifier "pbxproj"
= "="
try_expression
call_expression
identifier "load_pbxproj"
arguments
( "("
reference_expression
& "&"
identifier "config"
) ")"
? "?"
; ";"
line_comment
// "//"
expression_statement (+67 nodes collapsed)
expression_statement (+26 nodes collapsed)
call_expression (+23 nodes collapsed)
} "}"
attribute_item
# "#"
[ "["
attribute
identifier "allow"
token_tree
( "("
identifier "clippy"
:: "::"
identifier "too_many_arguments"
) ")"
] "]"
function_item (+721 nodes collapsed)
function_item (+127 nodes collapsed)

After

source_file
line_comment
// "//"
line_comment
// "//"
line_comment
// "//"
use_declaration (+33 nodes collapsed)
use_declaration (+84 nodes collapsed)
use_declaration
use "use"
scoped_use_list
identifier "clap"
:: "::"
use_list
{ "{"
identifier "ArgAction"
, ","
identifier "Parser"
} "}"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "anyhow"
:: "::"
identifier "Context"
; ";"
use_declaration (+49 nodes collapsed)
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "std"
:: "::"
identifier "env"
:: "::"
identifier "set_current_dir"
; ";"
const_item
const "const"
identifier "PHYSICAL_IPHONE_DEV_WARNING"
: ":"
reference_type
& "&"
primitive_type "str"
= "="
string_literal
" "\""
string_content "To develop on physical phones you need the `--host` option ("...
" "\""
; ";"
attribute_item
# "#"
[ "["
attribute
identifier "derive"
token_tree
( "("
identifier "Debug"
, ","
identifier "Clone"
, ","
identifier "Parser"
) ")"
] "]"
attribute_item (+22 nodes collapsed)
struct_item (+428 nodes collapsed)
impl_item (+137 nodes collapsed)
function_item (+86 nodes collapsed)
function_item
fn "fn"
identifier "run_command"
parameters
( "("
parameter
identifier "options"
: ":"
type_identifier "Options"
, ","
parameter
identifier "noise_level"
: ":"
type_identifier "NoiseLevel"
) ")"
-> "->"
generic_type
type_identifier "Result"
type_arguments
< "<"
unit_type
( "("
) ")"
> ">"
block
{ "{"
let_declaration
let "let"
identifier "env"
= "="
try_expression
call_expression
identifier "env"
arguments
( "("
) ")"
? "?"
; ";"
let_declaration (+88 nodes collapsed)
let_declaration (+23 nodes collapsed)
let_declaration (+65 nodes collapsed)
expression_statement (+21 nodes collapsed)
let_declaration (+73 nodes collapsed)
let_declaration
let "let"
tuple_pattern
( "("
identifier "interface"
, ","
identifier "config"
) ")"
= "="
block
{ "{"
let_declaration
let "let"
identifier "tauri_config_guard"
= "="
call_expression
field_expression
call_expression
field_expression
identifier "tauri_config"
. "."
field_identifier "lock"
arguments
( "("
) ")"
. "."
field_identifier "unwrap"
arguments
( "("
) ")"
; ";"
let_declaration
let "let"
identifier "tauri_config_"
= "="
call_expression
field_expression
call_expression
field_expression
identifier "tauri_config_guard"
. "."
field_identifier "as_ref"
arguments
( "("
) ")"
. "."
field_identifier "unwrap"
arguments
( "("
) ")"
; ";"
let_declaration (+23 nodes collapsed)
let_declaration
let "let"
identifier "app"
= "="
call_expression
identifier "get_app"
arguments
( "("
scoped_identifier
identifier "MobileTarget"
:: "::"
identifier "Ios"
, ","
identifier "tauri_config_"
, ","
reference_expression
& "&"
identifier "interface"
) ")"
; ";"
let_declaration
let "let"
tuple_pattern
( "("
identifier "config"
, ","
identifier "_metadata"
) ")"
= "="
try_expression
call_expression (+34 nodes collapsed)
? "?"
; ";"
tuple_expression
( "("
identifier "interface"
, ","
identifier "config"
) ")"
} "}"
; ";"
let_declaration
let "let"
identifier "tauri_path"
= "="
call_expression
identifier "tauri_dir"
arguments
( "("
) ")"
; ";"
expression_statement (+25 nodes collapsed)
expression_statement (+36 nodes collapsed)
expression_statement (+42 nodes collapsed)
let_declaration (+39 nodes collapsed)
let_declaration (+62 nodes collapsed)
expression_statement
try_expression
call_expression
field_expression
identifier "merged_info_plist"
. "."
field_identifier "to_file_xml"
arguments
( "("
reference_expression
& "&"
identifier "info_plist_path"
) ")"
? "?"
; ";"
let_declaration
let "let"
mutable_specifier "mut"
identifier "pbxproj"
= "="
try_expression
call_expression
identifier "load_pbxproj"
arguments
( "("
reference_expression
& "&"
identifier "config"
) ")"
? "?"
; ";"
line_comment
// "//"
expression_statement (+67 nodes collapsed)
expression_statement (+26 nodes collapsed)
call_expression (+23 nodes collapsed)
} "}"
attribute_item
# "#"
[ "["
attribute
identifier "allow"
token_tree
( "("
identifier "clippy"
:: "::"
identifier "too_many_arguments"
) ")"
] "]"
function_item (+721 nodes collapsed)
function_item (+127 nodes collapsed)