> > > Maybe we could come back to the original question how to avoid unnecessary > initializations during the the creation of a new vector by parts of other > vectors. The standard requires to use make-vector and vector-copy which > initializes the new vector twice. > > Is here a broad consent that it is not worth to care about, because one > should disregard vectors in favour of gap buffers? >
If your implementation supports SRFI 43 ( http://srfi.schemers.org/srfi-43/srfi-43.html ) or similar, then you can use vector-unfold or vector-unfold-right to create and initialize a vector all at once. IMO, small constant-factor costs, like the time to initialize an array, are not a big concern in Scheme code. For reference, a quick test shows my 2 year old laptop can memset approx. 3.7 GB/sec. So this cost is almost certainly dominated by other factors. In cases where this kind of thing makes a user-visible make-or-break difference, I'd probably need to be write assembly or low-level C anyway. So I prefer for Scheme code to do the Right Thing even at the expense of some small constant factors here and there. I would not go so far as to say there is broad consent to this position. Best regards, Kevin Wortman
_______________________________________________ Scheme-reports mailing list [email protected] http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports
