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

Table for complexity of common operations across backends #1726

Open
AlexDaniel opened this issue Dec 31, 2017 · 7 comments
Open

Table for complexity of common operations across backends #1726

AlexDaniel opened this issue Dec 31, 2017 · 7 comments
Labels
docs Documentation issue (primary issue type) wishlist "nice to have" issues; might require a lot of work or a big change or be low priority

Comments

@AlexDaniel
Copy link
Member

AlexDaniel commented Dec 31, 2017

See this: https://irclog.perlgeek.de/perl6/2017-11-16#i_15456401
And this: https://irclog.perlgeek.de/perl6/2017-12-31#i_15637372

This makes me want to have a table like this:

⚠ Feel free to edit this table!

Operation MoarVM JVM JavaScript
%hash.elems O(1) O(1) O(n)
@arr.elems, $list.elems O(1) O(1) O(1)
$seq.elems O(?) O(?) O(?)
@arr.push O(?) O(?) O(?)
@arr.pop O(?) O(?) O(?)
@arr.shift O(?) O(?) O(?)
@arr.unshift O(?) O(?) O(?)
@arr[$n] O(?) O(?) O(?)
$seq[$n] O(?) O(?) O(?)
$hash{$x} O(?) O(?) O(?)
@arr[$x]:delete O(?) O(?) O(?)
%hash[$x]:delete O(?) O(?) O(?)
%hash.push($p) O(?) O(?) O(?)

Footnotes (use these for caveats and other notes):
ᵃ – …
ᵇ – …
ᶜ – …

@AlexDaniel
Copy link
Member Author

If someone feels boring, here are all mentions of O(n) in clog.

@tisonkun
Copy link
Member

👍 on this. Anyway we have to decide where this table should be. Below language/operators or a new page like language/efficiency. The table itself can be filled by contributors later.

@AlexDaniel
Copy link
Member Author

It can also be on the FAQ page. Add a question like “What's the complexity of …?” and put a table there.

@tisonkun
Copy link
Member

It can also be on the FAQ page.

That will be better :-)

@AlexDaniel
Copy link
Member Author

I've added a bunch of rows into the table.

@AlexDaniel AlexDaniel added the docs Documentation issue (primary issue type) label Jan 6, 2018
@JJ
Copy link
Contributor

JJ commented May 15, 2018

This would be quite complicated to maintain. And it's about implementation.

@JJ JJ added the wishlist "nice to have" issues; might require a lot of work or a big change or be low priority label Mar 31, 2019
@JJ
Copy link
Contributor

JJ commented Mar 31, 2019

I come back to this to ask for closing this issue. It does not belong to documentation (but to implementation) and it would be impossible ot maintain (checking the complexity of the operation whenever there's a change). So I'm asking for closing it, will do so in a couple of days if no one says anything for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation issue (primary issue type) wishlist "nice to have" issues; might require a lot of work or a big change or be low priority
Projects
None yet
Development

No branches or pull requests

3 participants