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

Discuss performance benefits of native types #1534

Closed
AlexDaniel opened this issue Sep 4, 2017 · 8 comments
Closed

Discuss performance benefits of native types #1534

AlexDaniel opened this issue Sep 4, 2017 · 8 comments
Labels
docs Documentation issue (primary issue type)

Comments

@AlexDaniel
Copy link
Member

From #372 (comment):

Native int, num and so on can be used to speed up thing, like shaped Array. They are not only useful with NC

@AlexDaniel AlexDaniel added the docs Documentation issue (primary issue type) label Sep 4, 2017
@jnthn
Copy link
Contributor

jnthn commented Sep 4, 2017

Not only speed things up, but natively typed arrays can be a giant memory saving also where applicable.

@AlexDaniel AlexDaniel added LHF and removed LHF labels Nov 3, 2017
@AlexDaniel
Copy link
Member Author

AlexDaniel commented Nov 4, 2017

Where could this go? nativecall page is not exactly the right place. And as native types go, we only have int documented. After #372 all native types point to nativecall page but again that's not entirely right.

@jnthn
Copy link
Contributor

jnthn commented Nov 4, 2017

The int documentation is somewhat unfortunate in that it lists a load of methods you can call on a "native int". This not quite true, as you can't call a method, or indeed do anything object-y, on a native type. Calls to such methods will box the native integer into an Int and the method will be called on that (one can observe this by trying (my int $x = 42).WHAT and observing it says Int, not int - the reason is that the int was boxed into Int to have something to ask for the type object of).

Perhaps making the native int documentation describe what a native integer is, the sized variants, and its boxing behavior (with a link to Int documentation) would be more useful?

@JJ JJ added the TPF Grant label Apr 2, 2018
@JJ
Copy link
Contributor

JJ commented Apr 2, 2018

I can think either of a new performance issues page or the already existing traps page.

@AlexDaniel
Copy link
Member Author

@JJ no-no, I think this should go directly to the same place where native types are discussed. Unfortunately, I don't know about a page like this.

To clarify, a person searching for “int” should be able to eventually land on a page which discusses packed native arrays and stuff like that. And there we can say why the user may want to do that at all (e.g. for performance reasons).

@AlexDaniel
Copy link
Member Author

Currently searching for int gives https://docs.perl6.org/type/nativeInt which says “TODO”. Not good at all :(

There's also https://docs.perl6.org/language/nativecall but that's a different topic IMO.

@zoffixznet
Copy link
Contributor

FWIW the CaR grant branch that'll be merged after next release (2018-05-19) adds a "Numerics" language page that does mention native types as well as their performance benefits, including the case where they're lost because code does a lot of boxing.

@JJ
Copy link
Contributor

JJ commented May 13, 2018 via email

@JJ JJ removed the JJ TPF Grant label May 14, 2018
JJ added a commit that referenced this issue May 30, 2018
This file actually did not have anything, causing more confusion than
benefit, as indicated by @jnthn in #1534. The native types are right
now described in nativecall, but they will be moved somewhere else, as
per #1512.

Also changes redirection to the new page that includes all these types.
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)
Projects
None yet
Development

No branches or pull requests

5 participants