Skip to content

speed up crc computation by migrating to crc-fast#497

Draft
onur-ozkan wants to merge 6 commits into
mavlink:masterfrom
Orkavian:migrate-to-crc-fast
Draft

speed up crc computation by migrating to crc-fast#497
onur-ozkan wants to merge 6 commits into
mavlink:masterfrom
Orkavian:migrate-to-crc-fast

Conversation

@onur-ozkan

@onur-ozkan onur-ozkan commented May 30, 2026

Copy link
Copy Markdown
Member

A basic benchmark comparison I ran on an RP5:

workload                               frames    crc bytes     passes   crc-any ns/crc  crc-fast ns/crc    speedup

command_long v2                             1           39    3441480           156.41            74.53      2.10x
heartbeat v2                               46          828     162098            82.98            72.57      1.14x
servo_output_raw v2                        37         1702      78858           181.34            75.82      2.39x
raw_imu v2                                 37         1406      95460           153.21            75.84      2.02x
gps_raw_int v2                             37         2257      59467           234.13            77.18      3.03x
system_time v2                             36          756     177536            93.56            72.42      1.29x

So we get a good amount of speed simply by replacing the dependency.

Note that crc-fast is not only a faster CRC implementation but it is also more widely used. According to crates.io, as of today, it has over 18 million more downloads than crc-any.

Blocked by: awesomized/crc-fast-rust#49

Signed-off-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Onur Özkan <work@onurozkan.dev>
@onur-ozkan onur-ozkan added scope:dependencies Updates dependency versions or dependency related files risk:performance Change may affect speed, memory use or overall efficiency in the negative way. scope:core Affects the core library logic. labels May 30, 2026
@onur-ozkan

This comment was marked as outdated.

Signed-off-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Onur Özkan <work@onurozkan.dev>
@onur-ozkan onur-ozkan force-pushed the migrate-to-crc-fast branch from 46006d7 to 35657e0 Compare May 30, 2026 14:35
Keeps build-dependency features separate from embedded
target features.

Signed-off-by: Onur Özkan <work@onurozkan.dev>
Bindgen runs on the host while generating MAVLink code
where std is always available.

Signed-off-by: Onur Özkan <work@onurozkan.dev>
@onur-ozkan onur-ozkan marked this pull request as ready for review June 5, 2026 17:09
@onur-ozkan onur-ozkan changed the title WIP: speed up crc computation by migrating to crc-fast speed up crc computation by migrating to crc-fast Jun 5, 2026
@onur-ozkan onur-ozkan marked this pull request as draft June 5, 2026 19:13
@onur-ozkan onur-ozkan added the status:blocked Work cannot continue yet because another issue or dependency must be resolved first. label Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:performance Change may affect speed, memory use or overall efficiency in the negative way. scope:core Affects the core library logic. scope:dependencies Updates dependency versions or dependency related files status:blocked Work cannot continue yet because another issue or dependency must be resolved first.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant