Skip to content

Conversation

@FauxFaux
Copy link
Collaborator

@FauxFaux FauxFaux commented Jan 21, 2023

The start of this branch, which is kinda reasonable, is roughly 4x improvement on (+/%#)i. 1e7 here; 14-ish to 3-ish seconds. (I don't approve of the benchmark strategy.) This was all merged.

Most of the remaining time is being spent inside v_plus converting to and from JArray -> Num::Int -> i64 -> Num::Int -> JArray and back again.

The end of this branch adds a fastpath for the "sum idiom" explicitly, and now we're faster than python and ijconsole, although ijconsole is probably spending most of its time loading the stdlib and not running the code.

I don't think we should add this fastpath until we can work out what the generic form of this is. What property of + makes this possible, and where do we store whether something has that property?

(Also, do we handle overflows? Should we?)

@FauxFaux FauxFaux marked this pull request as ready for review January 21, 2023 17:08
@FauxFaux FauxFaux mentioned this pull request Jan 22, 2023
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

Successfully merging this pull request may close these issues.

1 participant