-
Notifications
You must be signed in to change notification settings - Fork 368
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
chore: redefine Nat.bit
and csimp
lemma for Nat.bit
#19666
base: master
Are you sure you want to change the base?
Conversation
PR summary 8185f68dedImport changes for modified filesNo significant changes to the import graph Import changes for all files
Declarations diff
You can run this locally as follows## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>
## more verbose report:
./scripts/declarations_diff.sh long <optional_commit> The doc-module for No changes to technical debt.You can run this locally as
|
Could you please explain why you want to do this? I've never seen a Could you include some form of benchmark showing the |
def bit (b : Bool) (n : Nat) : Nat :=
cond b (2 * n + 1) (2 * n)
def bitImpl (b : Bool) (n : Nat) : Nat :=
cond b (n <<< 1 + 1) (n <<< 1)
def run_bit (n : Nat) (x : Nat) : IO Unit := do
let mut t := 0
for _ in [0 : n] do
t := bit false x
def run_bitImpl (n : Nat) (x : Nat) : IO Unit := do
let mut t := 0
for _ in [0 : n] do
t := bitImpl false x
def n := 10^4
def x := 11^1000000
#eval timeit "bit" (run_bit n x) -- bit 620ms
#eval timeit "bitImpl" (run_bitImpl n x) -- bitImpl 433ms |
Although I'm by no means an expert here (and never use |
I don’t have a strong take here, but it does seem marginal. For one thing the code is branching, but my guess is that there’s some other even faster version. |
@FR-vdash-bot, could you say a bit more about why you want this? Do you have a performance-critical compiled application that calls |
split from #13649