From: SourceForge.net <no...@so...> - 2008-04-28 23:47:28
|
Patches item #1953758, was opened at 2008-04-29 01:47 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=310894&aid=1953758&group_id=10894 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 12. ByteArray Object Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Alexandre Ferrieux (ferrieux) Assigned to: Donal K. Fellows (dkf) Summary: CONCAT1 of ByteArrays Initial Comment: So far, the CONCAT1 instruction goes through the string reps of all objects, even when all are byte arrays. This compromises performance in heavy byte-juggling code since it means converting back and forth to UTF-8. This is odd since [string range] et al. do have an optimization for the byte array case. The attached patch (against 8.5.1) fixes that, by first looping through all to-be-concatenated objects to check whether they are all byte arrays (or empty strings). In that case, all operations are done at byte array level, while keeping the very same logic regarding in-place operation if possible (unshared first object). Moreover, the inclusion of the empty string case allows for the "K-free K" idiom $x[set x {}], which in the end allows the following in-place byte array growing operation: set x $x[set x {}]$y Test suite OK, and stepped through gdb to check most branches. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=310894&aid=1953758&group_id=10894 |