-
Notifications
You must be signed in to change notification settings - Fork 479
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
[Evaluation] [Names] Define all lookups in terms of 'contIndexZero' #6702
base: master
Are you sure you want to change the base?
[Evaluation] [Names] Define all lookups in terms of 'contIndexZero' #6702
Conversation
/benchmark validation |
/benchmark nofib |
/benchmark lists |
Click here to check the status of your benchmark. |
Comparing benchmark results of 'validation' on 'efaadc5ce9' (base) and '40a378f84b' (PR) Results table
|
Click here to check the status of your benchmark. |
Comparing benchmark results of 'nofib' on 'efaadc5ce9' (base) and '40a378f84b' (PR) Results table
|
Click here to check the status of your benchmark. |
Comparing benchmark results of 'lists' on 'efaadc5ce9' (base) and '40a378f84b' (PR) Results table
|
/benchmark nofib |
2 similar comments
/benchmark nofib |
/benchmark nofib |
Click here to check the status of your benchmark. |
Comparing benchmark results of 'nofib' on 'efaadc5ce9' (base) and '40a378f84b' (PR) Results table
|
Click here to check the status of your benchmark. |
Comparing benchmark results of 'nofib' on 'efaadc5ce9' (base) and '40a378f84b' (PR) Results table
|
Click here to check the status of your benchmark. |
Comparing benchmark results of 'nofib' on 'efaadc5ce9' (base) and '40a378f84b' (PR) Results table
|
/benchmark lists |
/benchmark nofib |
/benchmark validation |
Click here to check the status of your benchmark. |
Comparing benchmark results of 'lists' on 'efaadc5ce' (base) and '40a378f84' (PR) Results table
|
Click here to check the status of your benchmark. |
Comparing benchmark results of 'nofib' on 'efaadc5ce' (base) and '40a378f84' (PR) Results table
|
Click here to check the status of your benchmark. |
Comparing benchmark results of 'validation' on 'efaadc5ce' (base) and '40a378f84' (PR) Results table
|
40a378f
to
22bb3a2
Compare
length Nil = 0 | ||
length (BHead sz _ tl) = sz + RAL.length tl | ||
{-# INLINABLE indexZero #-} | ||
{-# INLINE uncons #-} | ||
|
||
length = go 0 where | ||
go acc Nil = acc | ||
go acc (BHead sz _ tl) = go (acc + sz) tl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if it's important to make this one fast, but why not while we're here. It's more readable too, in my opinion.
empty = Nil | ||
{-# INLINABLE cons #-} | ||
{-# INLINE empty #-} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We really want all of that to inline, no point is chickening out and saying INLINABLE
.
@@ -878,7 +878,7 @@ enterComputeCek = computeCek | |||
-- | Look up a variable name in the environment. | |||
lookupVarName :: NamedDeBruijn -> CekValEnv uni fun ann -> CekM uni fun s (CekValue uni fun ann) | |||
lookupVarName varName@(NamedDeBruijn _ varIx) varEnv = | |||
Env.safeIndexOneCont | |||
Env.contIndexOne |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This names better matches the other names in the module, should've gone with it originally.
Instead of 4 different implementation this will make it 1 main and 3 derivative ones.
This appears to make the
validation
benchmarks faster by a percent and thenofib
benchmarks faster by a couple of percent while simplifying the code, so a clear win.Please review this one VERY carefully.