-
Notifications
You must be signed in to change notification settings - Fork 8
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
Intent to work on "array foreach" (new array ensemble command in C). #12
Comments
A previously existing TIP was opened by karl years ago but never finished. The template might be reusable as the basis for this new TIP. http://www.tcl.tk/cgi-bin/tct/tip/421.html |
Yes, thanks. I am going to ask whether that TIP should be updated or create a new TIP. |
Please note that the primary motivation of this enhancement is not just a syntactic improvement, but an actual performance improvement by eliminating the need to duplicate the array with [array get] Providing benchmarks that support the efficiency of your implementation over the traditional commands required today would provide additional rationale for the TIP to be accepted. |
Correct. My implementation does not create a new list. |
Memory footprint: memory savings are significant. testing runtime speed is a problem, as there is no bytecode compilation for 'array for'. |
The code is on a development branch at http://core.tcl.tk/tcl/timeline?r=lanam-array-for-impl While I've added a bit to the code, I don't consider my changes to be anything other than normal Tcl maintainer work, i.e., not eligible for the bounty. Also, being on a development branch on core is not a satisfaction of the bounty conditions. (If nothing else, there's also a need for documentation and for the code to not crash when there's an unexpected purge of the iterator…) |
'array for' is working.
Benchmark with 100000 entries in the array
I would attach the code, but unfortunately I have checked it into my local fossil repo, and I have no idea how to get a proper diff out (it displays changes that are part of some prior check-in). I can always reapply the changes to a known base again -- it's not that much code. Needed: TIP changes, Code review. |
Is that right, a loop using foreach/array get uses more memory but is faster than array for? |
It is not bytecoded like |
Some brainstorming discussion in: My to-do, I will have this done before 2017-11-1.
The remaining items are separate tasks and need more discussion. Insertions: Two possibilities: Deletions: Updates: For updates and deletions, have to figure out when the saved items can be |
Going full transactional with WAL-like behavior so that updates (not inserts or deletes) are hidden from the iterator is absolutely not a requirement. :) |
Ok, won't let me attach the file, but here is the code so that it will not get lost.
|
The code has been commited to branch: bll-array-for, and the TIP is updated. |
The code is now in branch tip-421, based on 8.7. There is a TIP, Steve Landers is sponsoring the TIP, and there is a discussion started in the tcl-core mailing list. |
TIP 421 has been accepted and is now in the core-8-branch and will be present in the next alpha release of 8.7. The implementation is just a wrapper around array startsearch/next/donesearch, as most people want the |
…unties#12 for details. FossilOrigin-Name: bd05353216cc56ffc17f11dc0ad6c5f3fde79536
brad.lanam.comp @ gmail.com
Working 2016-11-21
Aborted iteration due to array changes working 2017-5-1
Working 2016-11-22
Aborted iteration due to array changes working 2017-5-1
This variant has been removed
Complete
Done 2017-5-1, including tests for aborted iteration due to array changes
DGP did a code review, cleaned up and added another test 2018-4-19
TIP 421 is posted and is being sponsored by Steve Landers (2018-3-6)
TIP 421 accepted and added to the core-8-branch 2018-4-20
The code is now in branch 'tip-421', based on 8.7. 2018-3-6
The text was updated successfully, but these errors were encountered: