[Issue 4483] foreach over string or wstring, where element type not specified, does not support unicode

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Apr 6 00:13:26 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=4483

Dmitry Olshansky <dmitry.olsh at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dmitry.olsh at gmail.com

--- Comment #18 from Dmitry Olshansky <dmitry.olsh at gmail.com> ---
(In reply to Walter Bright from comment #11)
> > You fail to recognize that it's broken from the begging.
> 
> and I know that std.regex suffered serious
> slowdowns because of it.

This turned out to be factually wrong, after I've spent a year and a half
constructing a non-decoding version of std.regex for no significant gain ;) A
brief exercise with a profiler shows decoding to be ~0.5% in a recent version,
as Martin points out a single 100% predictable comparison is not a problem. 

The only case where not decoding is faster is bulk-mode operations that can
take advantage of SIMD or auto-vectorization, such as:
a) Skipping comments (i.e. looping until '*' is hit then check for '/')
b) Comparing strings or searching for substring.

--


More information about the Digitalmars-d-bugs mailing list