@alexheretic alexheretic released this Jun 29, 2018 · 88 commits to master since this release

Assets 2
  • Layout code rework to a much cleaner implementation of layered iterators (#28)
    • Fixes issues with varied sections having inherent soft-breaks between SectionTexts.
    • Remove built in unicode normalization
    • Breaks GlyphPositioner implementations (not much implemented outside this crate afaik). But is now simpler to implement.
    • Add VerticalAlign::Bottom, VerticalAlign::Center (#33)
    • Fix single word larger than bounds issue (#34)
  • Fix BuiltInLineBreaker::AnyCharLineBreaker mishandling byte-indices in some cases.
  • Remove deprecated functions.
  • Support raw gfx render & depth views (#30)
  • Use generic section hashing for GlyphBrush & GlyphCalculator caches. This means the default section hashing can be overridden to a different algorithm if desired (similarly to HashMap).
  • Use seahash by default for section hashing. Previously this was done with an xxHash. Seahash is a little slower for large sections, but faster for small ones. General usage see many small sections & few large ones so seahash seems a better default.

Performance

Worst-case (cache miss) benchmark performance, which is the most important area to improve, is hugely improved by the layout rework. 1.55-2.16x faster than 0.11.

name                                       control ns/iter  change ns/iter  diff ns/iter   diff %  speedup 
no_cache_render_100_small_sections_fully   7,267,231        4,691,164         -2,576,067  -35.45%   x 1.55 
no_cache_render_1_large_section_partially  1,566,127        725,086             -841,041  -53.70%   x 2.16 
no_cache_render_3_medium_sections_fully    4,051,124        1,963,114         -2,088,010  -51.54%   x 2.06 

Best-case (cached) performance changes are generally less important, but the affect of moving from xxHash to seahash can be seen.

name                                       control ns/iter  change ns/iter  diff ns/iter   diff %  speedup 
render_100_small_sections_fully            34,219           24,757                -9,462  -27.65%   x 1.38 
render_1_large_section_partially           2,634            3,972                  1,338   50.80%   x 0.66 
render_3_medium_sections_fully             1,584            1,504                    -80   -5.05%   x 1.05