Repository navigation
Precompile displaying N0f8 and N0f16 - #352
PatrickHaecker wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #352 +/- ##
==========================================
+ Coverage 97.22% 97.25% +0.02%
==========================================
Files 7 7
Lines 792 800 +8
==========================================
+ Hits 770 778 +8
Misses 22 22 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Personally, I believe this is worthwhile. |
|
BTW, I am considering registering the TTFX benchmark snippet for Colors.jl. Displaying |
Showing a value or a vector for the first time was the slowest first use of the package. Precompiling `show` and `print` for the terminal and for buffers cuts the first display in the terminal from 302 to 82 ms on Julia 1.10 and from 913 to 88 ms on Julia 1.13, and the first `repr` from 438 to 113 ms and from 553 to 107 ms. Loading becomes 8 ms (1.10) and 2 ms (1.13) slower, and the package image grows by about 1 MiB. Invalidations do not change, neither from loading the package nor from loading ColorTypes and Colors afterwards.
Scripts whose output is piped, such as CI jobs and TTFX benchmarks, print
through `IOContext{Base.PipeEndpoint}`. Without these directives, the first
display of an `RGB{N0f8}` vector takes about 2 s on Julia 1.13 and 1.4 s on
1.10, with them about 0.4 s.
2a403a1 to
9b952ff
Compare
I am not sure whether I understood what you have asked for here. However, I let the agent check whether we can do something to accelerate the use case and indeed we can. Turns out that precompiling 🤖:
👨: |
Showing a value or a vector for the first time was slow. Precompiling
showandprintfor the terminal and for buffers cuts the first display in the terminal from 302 to 82 ms on Julia 1.10 and from 913 to 88 ms on Julia 1.13, and the firstreprfrom 438 to 113 ms and from 553 to 107 ms. Loading becomes 8 ms (1.10) and 2 ms (1.13) slower, and the package image grows by about 1 MiB. Invalidations do not change, neither from loading the package nor from loading ColorTypes and Colors afterwards.