-
Notifications
You must be signed in to change notification settings - Fork 16
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
.WHEN #8
Comments
This is a bit of a naive example, but the performance implications are pronounced enough to make me think its impractical. |
What about creating a module “WHEN::Hash” for those who need it instead of imposing the overhead on everyone? BTW, @jnthn can you publish your document about language design principles? |
Yes. Yes, that is. AlexDaniel's suggestion about a module is well taken, but if something like this can be boiled down to maybe 0.7s, would it be worthwhile? Does nqp have a native version of .now -- one that returns POSIX seconds? Might be better to benchmark that, instead. |
Well, this is unexpected!
(Caching?) Of course, it really isn't that simple. This would occur at STORE, not new() |
A EDIT: actually I didn't notice it was faster |
Yes, but all I really need is a num. Yes, the original message was about DateTime, but posix_t is good enough and still accomplishes the goal. EDIT: That was why it was unexpected =) |
|
We could do this all day. I guess I need to reboot and do this outside a VM, because this just doesn't make sense!
Also, am doing this on Linux kernel v5.
|
First, about the discrepancy: it turns out there's a performance bug lurking here. For an object with attributes, we would generate a The dynamic optimizer is getting increasingly sophisticated, and benchmarks like these are liable to prove little. Having fixed the
Has the object allocation optimized out completely thanks to escape analysis and resultant optimizations, meaning after optimization it turns into an empty loop body. It's not yet sophisticated enough to do the same trick for an object with an attribute that is initialized but then never read, but that's only a matter of time; it already knows that As to the All the same, I'm glad you opened the issue, because it led to a performance bug being fixed. @AlexDaniel I can look into cleaning up and publishing such a document, but I'm not immediately sure where to put it; any suggestions? |
roast/docs/, and please take a look at this existing document: Policy For Implementation of New Features |
To clarify, we will of course link to it from this repo too (from the issue template), but roast seems to be a more fitting place for it right now. |
And to clarify even more, yes, such documents can be added to this repo too (by going through the whole process), but currently I don't see any good reason to do that. @jnthn if you feel like waiting for all reviewers to approve what's written in that upcoming document, then surely feel free to follow the process in this repo. Otherwise you can have a document that you'd be able to tweak at any time, which IMO makes more sense. |
Well, module space it is. Thanks, everyone! Any suggestions for naming? |
Just to brainstorm.
Would it be possible to fill out the .WHAT, .WHERE, .WHY, .HOW, with a .WHEN?
.WHEN would store the DateTime when the variable was last defined.
Would this incur a significant amount of change in CORE.setting?
How much of a performance penalty would this incur?
How much more memory would this use?
Does this really need a use-case define? If so, I can provide a simple one:
Is this enough to jumpstart a conversation?
The text was updated successfully, but these errors were encountered: