Skip to content
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

Convert return value of Eval and Resumable trait to SmallVec of default size 1 #16

Open
maplant opened this issue Nov 8, 2024 · 0 comments

Comments

@maplant
Copy link
Owner

maplant commented Nov 8, 2024

Scheme allows for the returning of multiple values for an expression, and thus we must support that. However, the vast majority of the time only one value will be returned. Therefore, we can optimize the Eval and Resumable traits to return a small vec of size 1:

pub trait Eval {
    async fn eval(
        &self,
        env: &Env,
        cont: &Option<Arc<Continuation>>,
    ) -> Result<SmallVec<[Gc<Value>; 1]>, RuntimeError>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant