linebender / norad

Rust crate for working with Unified Font Object files
Apache License 2.0
43 stars 12 forks source link

Wrap file writes with `close_already` (perf increase on Windows) #335

Closed RickyDaMa closed 10 months ago

RickyDaMa commented 10 months ago

Per the benchmark results from my machine here, we see a 5% decrease in write time with rayon enabled, and 50% decrease in write time with default features

If we don't want the benchmark/Roboto in-tree, let me know and I can remove it. The Roboto is the latest from the repo, with most/all lib keys removed from glyphs

Let me know if there are any writes I've missed wrapping!

If you want to read more and/or audit the new dependency: alpha-tango-kilo/close_already

Will close #334

cmyr commented 10 months ago

I'm open to merging this, but I would prefer not to add 10mb of test data to this repo. I don't think it's critical that we commit the benchmarks in any case? if we want to have some mechanism for timing the writing of a file, we do have the load_save example that will read and write a UFO, and can be passed an arbitrary font file.

RickyDaMa commented 10 months ago

Removed benchmarks. They can live on in my personal fork