[Issue 7442] ctRegex!`\p{Letter}` uses a lot memory in compilation

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jun 6 23:21:27 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=7442


Jameson <beatgammit at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |beatgammit at gmail.com


--- Comment #13 from Jameson <beatgammit at gmail.com> 2013-06-06 23:21:22 PDT ---
(In reply to comment #12)
> (In reply to comment #0)
> > Test case:
> > 
> > ------------------------
> > import std.regex;
> > enum bug7442 = ctRegex!`\p{Letter}`;
> > ------------------------
> > 
> > Compile with `dmd -c test7442.d`. DMD will very quickly use up all system
> > memory. (I'll try to reduce the test case later.)
> 
> Now this compiles for me in 2.063:
> 
> import std.regex;
> enum bug7442 = ctRegex!`\p{Letter}`;
> 
> ------------------------
> Total time (ms): 11197.2
> 
> And even both cases combined:
> 
> import std.regex;
> enum bug7442 = ctRegex!`\p{Letter}`;
> void wcpx(string fn)
> {
>     enum ctr =  regex(r"\w+","g");
> }
> 
> ------------------------
> Total time (ms): 17443.3
> 
> The latter takes around 600Mb virtual memory as measured on Win7 x64 with
> 32-bit executable. DMD lately has been tweaked to actually use up to 2GB of
> memory on win32.
> 
> And the time is not all that bad.
> 
> Should we close this as the root case of improving dmd's CTFE memory footprint
> is covered elsewhere? Just asking.

This now also compiles for me. I haven't tested the memory usage very well, but
it seems to only use about 400mb or so on my machine, which is completely
reasonable.  Time is consistently around 3.5 seconds, so I'm happy.

Platform: Arch Linux x86_64.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list