Ogeon / palette

A Rust library for linear color calculations and conversion
Apache License 2.0
749 stars 60 forks source link

Add an "alloc" feature and make tests work with any feature combination #373

Closed Ogeon closed 7 months ago

Ogeon commented 7 months ago

Split out a separate "alloc" feature, that can be used without "std". This allows allocations on platforms that still allow them without the std library.

Also makes it possible to run tests with any feature combination (without doc-tests, at the moment).

Closed Issues

codecov[bot] commented 7 months ago

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (4c97fb5) 81.46% compared to head (6d96f73) 81.50%. Report is 2 commits behind head on master.

Files Patch % Lines
palette/src/okhsl.rs 96.07% 4 Missing :warning:
palette/src/okhwb.rs 96.96% 2 Missing :warning:
palette/src/hues.rs 99.05% 1 Missing :warning:
palette/src/okhsv.rs 99.41% 1 Missing :warning:
palette/src/oklch.rs 98.33% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #373 +/- ## ========================================== + Coverage 81.46% 81.50% +0.03% ========================================== Files 113 113 Lines 18438 18526 +88 Branches 18438 18526 +88 ========================================== + Hits 15021 15100 +79 - Misses 3220 3229 +9 Partials 197 197 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codspeed-hq[bot] commented 7 months ago

CodSpeed Performance Report

Merging #373 will degrade performances by 20.49%

:warning: No base runs were found

Falling back to comparing alloc_and_any_features_in_tests (6d96f73) with master (4c97fb5)

Summary

⚡ 1 improvements ❌ 1 regressions ✅ 43 untouched benchmarks

:warning: _Please fix the performance issues or acknowledge them on CodSpeed._

Benchmarks breakdown

Benchmark master alloc_and_any_features_in_tests Change
matrix_inverse 215.6 ns 271.1 ns -20.49%
multiply_3x3 427.8 ns 372.2 ns +14.93%
Ogeon commented 7 months ago

@jonassmedegaard, you may want to have a look at this. I think I managed to find a good middle ground where the unit tests can run with any feature set. I didn't manage to get the doc-tests to work equally well, so I hope that's no issue.

A couple of things to keep in mind:

I don't know if you are able to test run your setup on this branch, but I hope it will let you skip the patch.