-
Notifications
You must be signed in to change notification settings - Fork 33
Improve generation of typealiases #233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## master #233 +/- ##
==========================================
- Coverage 95.68% 95.57% -0.12%
==========================================
Files 6 6
Lines 742 746 +4
==========================================
+ Hits 710 713 +3
- Misses 32 33 +1
Continue to review full report at Codecov.
|
aaf1396
to
c3304ef
Compare
I am going to try to see if the symbol-generating "macro" is effective. |
I've tried several metaprogramming techniques and generated function seems to be the simplest. julia> versioninfo()
Julia Version 1.6.0-DEV.1050
Commit fd57021b33 (2020-09-25 18:40 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-10.0.1 (ORCJIT, skylake)
julia> @time using FixedPointNumbers
[ Info: Precompiling FixedPointNumbers [53c48c17-4a7d-5ca2-90c5-79b7896eea93]
2.279809 seconds (213.42 k allocations: 13.772 MiB, 0.25% gc time) # master
1.179185 seconds (209.43 k allocations: 13.267 MiB) # this PR printing julia> versioninfo()
Julia Version 1.5.2
Commit 539f3ce943 (2020-09-23 23:17 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-9.0.1 (ORCJIT, skylake)
julia> @benchmark dump(io, $img) # master
BenchmarkTools.Trial:
memory estimate: 1.70 MiB
allocs estimate: 9216
--------------
minimum time: 740.600 μs (0.00% GC)
median time: 1.450 ms (0.00% GC)
mean time: 1.666 ms (16.23% GC)
maximum time: 181.050 ms (0.46% GC)
--------------
samples: 3000
evals/sample: 1
julia> @benchmark dump(io, $img) # this PR
BenchmarkTools.Trial:
memory estimate: 1.70 MiB
allocs estimate: 9216
--------------
minimum time: 622.900 μs (0.00% GC)
median time: 1.344 ms (0.00% GC)
mean time: 1.562 ms (17.51% GC)
maximum time: 202.086 ms (8.59% GC)
--------------
samples: 3211
evals/sample: 1 The original reason for submitting this PR is never to speed up printing colors, but I am not in a position to negate the need for the specialization anymore. I will modify this PR as you asked and will not merge this PR unless there is a consensus. |
The essence of this PR is to reduce the precompile time and to support two-character type prefixes. |
This is yet another solution for the issue which is going to be fixed by PR #232.
This also includes the preparation for #228. I don't believe
typechar
is used in other packages, but I've added depwarn because there are cases whereshowtype
is used.Edit:
This PR is not intended to replace #232, but to demonstrate a different approach. However, in any case, I believe that some fixes will be required for #228.