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

Add NoSeek #487

Merged
merged 2 commits into from
Oct 29, 2024
Merged

Add NoSeek #487

merged 2 commits into from
Oct 29, 2024

Conversation

wcampbell0x2a
Copy link
Collaborator

  • Add NoSeek to implement Seek for types that won't need to seek, but have the trait impl.

Copy link

github-actions bot commented Oct 2, 2024

Benchmark for 479558b

Click to view benchmark
Test Base PR %
count 5.1±0.08µs 5.0±0.02µs -1.96%
deku_read_bits 1153.9±19.96ns 1183.2±19.07ns +2.54%
deku_read_byte 5.3±0.12ns 5.3±0.11ns 0.00%
deku_read_enum 4.5±0.04ns 4.5±0.03ns 0.00%
deku_read_vec 42.4±0.37ns 42.5±0.32ns +0.24%
deku_write_bits 185.8±3.18ns 187.0±1.63ns +0.65%
deku_write_byte 25.1±0.44ns 25.2±0.47ns +0.40%
deku_write_enum 22.7±0.20ns 22.8±0.38ns +0.44%
deku_write_vec 424.9±6.78ns 426.0±9.16ns +0.26%
read_all 5.6±0.05µs 5.6±0.03µs 0.00%
read_all_bytes 5.7±0.05µs 5.6±0.04µs -1.75%

Copy link

github-actions bot commented Oct 2, 2024

Benchmark for 2483c29

Click to view benchmark
Test Base PR %
count 5.1±0.02µs 5.0±0.04µs -1.96%
deku_read_bits 1138.9±13.67ns 1172.7±12.42ns +2.97%
deku_read_byte 5.9±0.08ns 5.9±0.07ns 0.00%
deku_read_enum 4.7±0.02ns 5.2±0.04ns +10.64%
deku_read_vec 42.5±0.40ns 42.9±0.51ns +0.94%
deku_write_bits 185.1±1.34ns 184.8±3.16ns -0.16%
deku_write_byte 25.4±0.22ns 25.1±0.27ns -1.18%
deku_write_enum 22.8±0.48ns 22.8±0.38ns 0.00%
deku_write_vec 415.1±6.35ns 415.5±5.48ns +0.10%
read_all 3.8±0.05µs 5.6±0.04µs +47.37%
read_all_bytes 3.8±0.06µs 5.6±0.05µs +47.37%

* Add NoSeek to implement Seek for types that won't
need to seek, but have the trait impl.
Copy link

github-actions bot commented Oct 3, 2024

Benchmark for 5bdf9d0

Click to view benchmark
Test Base PR %
count 5.0±0.01µs 5.0±0.02µs 0.00%
deku_read_bits 1179.4±18.49ns 1174.2±11.64ns -0.44%
deku_read_byte 5.8±0.05ns 5.3±0.14ns -8.62%
deku_read_enum 5.3±0.06ns 4.5±0.02ns -15.09%
deku_read_vec 43.3±2.39ns 42.5±0.60ns -1.85%
deku_write_bits 185.1±2.69ns 185.6±2.48ns +0.27%
deku_write_byte 25.1±0.28ns 25.0±0.20ns -0.40%
deku_write_enum 22.8±0.33ns 23.0±1.43ns +0.88%
deku_write_vec 407.5±7.42ns 415.3±3.89ns +1.91%
read_all 5.6±0.20µs 5.7±0.17µs +1.79%
read_all_bytes 5.6±0.04µs 5.7±0.14µs +1.79%

sharksforarms
sharksforarms previously approved these changes Oct 21, 2024
Copy link
Owner

@sharksforarms sharksforarms left a comment

Choose a reason for hiding this comment

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

Thanks! For discovery purposes, it may be nice to have some addition to the docs.

(I'm not sure if a compile 'error'/hint helping the user is possible, but that'd be cool)

@wcampbell0x2a
Copy link
Collaborator Author

Thanks! For discovery purposes, it may be nice to have some addition to the docs.

Sure, will do.

(I'm not sure if a compile 'error'/hint helping the user is possible, but that'd be cool)

I wish, but I think since 'Seek` isn't a part of this crate, I dont control the diagnostics.

add more docs
@wcampbell0x2a
Copy link
Collaborator Author

@sharksforarms added!

Copy link

Benchmark for 47ac249

Click to view benchmark
Test Base PR %
count_from_u8_specialize 99.7±1.24ns 135.5±2.17ns +35.91%
count_no_specialize 2.4±0.02µs 2.4±0.03µs 0.00%
count_specialize 93.5±0.77ns 99.2±1.39ns +6.10%
deku_read_bits 1191.6±18.76ns 1190.4±19.44ns -0.10%
deku_read_byte 4.5±0.06ns 4.6±0.10ns +2.22%
deku_read_enum 3.8±0.06ns 3.8±0.06ns 0.00%
deku_read_vec 30.5±0.43ns 30.5±0.48ns 0.00%
deku_write_bits 205.6±11.25ns 202.1±6.99ns -1.70%
deku_write_byte 26.0±0.21ns 26.1±0.31ns +0.38%
deku_write_enum 24.1±1.40ns 24.4±2.74ns +1.24%
deku_write_vec 423.8±4.88ns 435.4±5.55ns +2.74%
read_all 4.2±0.08µs 4.2±0.08µs 0.00%
read_all_bytes 4.2±0.06µs 4.2±0.03µs 0.00%

@wcampbell0x2a wcampbell0x2a merged commit cbad152 into master Oct 29, 2024
12 of 15 checks passed
@wcampbell0x2a wcampbell0x2a deleted the add-noseek branch October 29, 2024 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants