Change to search_n

Chris Jefferson caj@cs.york.ac.uk
Sat Jan 29 13:59:00 GMT 2005


Dimitris Xochellis wrote:

>Chris Jefferson wrote in:
>
>http://gcc.gnu.org/ml/libstdc++/2004-08/msg00090.html
>
>  
>
>>Hi and thanks for your message.
>>    
>>
>
>  
>
>>During the next days I will analyze in detail your
>>proposal but, first, I'd like to ask your whether
>>    
>>
>your
>  
>
>>work is related to this algorithm which we were
>>already finding very interesting:
>>http://www.codeproject.com/vcpp/stl/SearchN.asp
>>    
>>
>
>Hello,
>
>I am the author of the above article and I am very 
>happy that you found it interesting. I just discovered
>this discussion thread and immediately after I have
>downloaded the latest(rev 1.50) stl_algo.h file from
>gcc/libstdc++-v3/include/bits/stl_algo.h.
>Unfortunately that file seems to contain only the
>traditional search_n implementation. :-( 
>
>What are the current status and your plans regarding
>the search_n implementation? Can I help in any way?
>
>  
>
Hello!

As Paolo has said, there was some worry this patch might slow things 
down in some cases.. in particular, I found it did slow things down when 
searching for strings of length 1 or 2 on some computers. Of course 
search_n for length 1 is just find, so we can ask find to do it, and I 
wrote a specialised version for length 2. I attach to this email my 
latest version from my personal gcc tree, which I am more than happy for 
you to comment on / suggest changes :)

As to submitting this into libstdc++, my personal current temptation was 
to submit it to the "so_7" branch, so called as it will be the next 
version of libstdc++ which is not binary compatable with the current 
version (so_6), mainly because I felt such a time was a good time to 
insert code which might change behaviour. Of course this code shouldn't 
change the behaviour of any code which follows the standard, but we've 
all seen enough badly written code to know it might upset someone..

Chris
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: new_search_n
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20050129/c046bdf5/attachment.ksh>


More information about the Libstdc++ mailing list