-
-
Notifications
You must be signed in to change notification settings - Fork 328
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
fix(object): Report remaining input on error #1104
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a million 🙏!
I love the way it is implemented, it's definitely the fast version as according to cargo bench
, the verbose-object-parsing-errors
feature only costs ~5% performance.
Before merging, I will wire this feature through to gix
to make it more accessible at least for those who compile their own applications.
Running benches/decode_objects.rs (/Users/byron/dev/github.com/Byron/gitoxide/target/release/deps/decode_objects-8c776e4e50ad3e33)
Gnuplot not found, using plotters backend
CommitRef(sig) time: [957.72 ns 958.65 ns 959.77 ns]
change: [-0.4286% -0.1787% +0.0716%] (p = 0.17 > 0.05)
No change in performance detected.
Found 15 outliers among 100 measurements (15.00%)
1 (1.00%) low mild
5 (5.00%) high mild
9 (9.00%) high severe
CommitRefIter(sig) time: [1.1116 µs 1.1141 µs 1.1172 µs]
change: [+3.0308% +3.3969% +3.7380%] (p = 0.00 < 0.05)
Performance has regressed.
Found 13 outliers among 100 measurements (13.00%)
9 (9.00%) high mild
4 (4.00%) high severe
TagRef(sig) time: [233.65 ns 234.08 ns 234.52 ns]
change: [-1.7170% -1.2014% -0.7539%] (p = 0.00 < 0.05)
Change within noise threshold.
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild
TagRefIter(sig) time: [229.47 ns 229.68 ns 229.94 ns]
change: [-3.4350% -3.2357% -3.0367%] (p = 0.00 < 0.05)
Performance has improved.
Found 16 outliers among 100 measurements (16.00%)
2 (2.00%) low mild
5 (5.00%) high mild
9 (9.00%) high severe
TreeRef() time: [113.73 ns 114.29 ns 114.84 ns]
change: [-0.7474% -0.2837% +0.1797%] (p = 0.25 > 0.05)
No change in performance detected.
TreeRefIter() time: [58.650 ns 58.755 ns 58.863 ns]
change: [-4.6312% -4.3588% -4.0678%] (p = 0.00 < 0.05)
Performance has improved.
Found 5 outliers among 100 measurements (5.00%)
5 (5.00%) high mild
gitoxide/gix-object ( error) [$] took 59s
❯ cargo bench --features verbose-object-parsing-errors
Compiling gix-object v0.38.0 (/Users/byron/dev/github.com/Byron/gitoxide/gix-object)
Finished bench [optimized] target(s) in 1.92s
Running unittests src/lib.rs (/Users/byron/dev/github.com/Byron/gitoxide/target/release/deps/gix_object-672e9f8d8fc85121)
running 9 tests
test commit::message::body::test_parse_trailer::extra_whitespace_before_token_or_value_is_error ... ignored
test commit::message::body::test_parse_trailer::simple_newline ... ignored
test commit::message::body::test_parse_trailer::simple_newline_windows ... ignored
test commit::message::body::test_parse_trailer::simple_non_ascii_no_newline ... ignored
test commit::message::body::test_parse_trailer::with_lots_of_whitespace_newline ... ignored
test data::tests::size_of_object ... ignored
test tag::write::tests::validated_name::invalid::leading_dash ... ignored
test tag::write::tests::validated_name::invalid::only_dash ... ignored
test tag::write::tests::validated_name::valid::version ... ignored
test result: ok. 0 passed; 0 failed; 9 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running benches/decode_objects.rs (/Users/byron/dev/github.com/Byron/gitoxide/target/release/deps/decode_objects-1b399221fa1bcccd)
Gnuplot not found, using plotters backend
CommitRef(sig) time: [1.0035 µs 1.0047 µs 1.0061 µs]
change: [+4.4469% +4.7063% +4.9665%] (p = 0.00 < 0.05)
Performance has regressed.
Found 9 outliers among 100 measurements (9.00%)
4 (4.00%) high mild
5 (5.00%) high severe
CommitRefIter(sig) time: [1.1742 µs 1.1759 µs 1.1777 µs]
change: [+5.6462% +5.9482% +6.2912%] (p = 0.00 < 0.05)
Performance has regressed.
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) high severe
TagRef(sig) time: [227.94 ns 228.07 ns 228.21 ns]
change: [-2.7380% -2.5092% -2.2793%] (p = 0.00 < 0.05)
Performance has improved.
Found 14 outliers among 100 measurements (14.00%)
8 (8.00%) high mild
6 (6.00%) high severe
TagRefIter(sig) time: [223.78 ns 224.06 ns 224.36 ns]
change: [-2.6417% -2.4527% -2.2566%] (p = 0.00 < 0.05)
Performance has improved.
Found 3 outliers among 100 measurements (3.00%)
2 (2.00%) high mild
1 (1.00%) high severe
TreeRef() time: [116.15 ns 116.40 ns 116.65 ns]
change: [+1.1316% +1.5443% +1.9590%] (p = 0.00 < 0.05)
Performance has regressed.
Found 23 outliers among 100 measurements (23.00%)
7 (7.00%) low severe
2 (2.00%) low mild
2 (2.00%) high mild
12 (12.00%) high severe
TreeRefIter() time: [58.631 ns 58.732 ns 58.838 ns]
change: [-0.4359% -0.2155% +0.0234%] (p = 0.06 > 0.05)
No change in performance detected.
Found 13 outliers among 100 measurements (13.00%)
5 (5.00%) high mild
8 (8.00%) high severe
gitoxide/gix-object ( error) [$] took 59s
This should make it easier to understand what's going on in case something isn't working as expected.
That way, it's easy to create programs that are geared towards debugging repositories and finding invalid objects with detailed errors.
Fixes #1099