www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10864] New: [REG 2.064][PERFORMANCE] new Safe appender is slower than "~="

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10864

           Summary: [REG 2.064][PERFORMANCE] new Safe appender is slower
                    than "~="
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: performance
          Severity: blocker
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: monarchdodra gmail.com


--- Comment #0 from monarchdodra gmail.com 2013-08-21 03:19:47 PDT ---
The new Appender is now  safe and pure. This was done mostly by
https://github.com/D-Programming-Language/phobos/pull/1337 , which is done with
heavy usage of the trusted lambda idiom, eg:

()  trusted {unsafe code here;} ();

The problem is that doing this has a very high runtime cost.

Currently, my benches get improved performance by *not* using appender.

This can be fixed either by using the same "named" idiom:
void do_it()  trusted {unsafe code here;}
do_it();

(for reasons I do not understand, *that* has no extra runtime cost, even in
non-optimized/non-inline mode).

Or by fixing:
http://d.puremagic.com/issues/show_bug.cgi?id=10848

Appender being one of the "foundation" blocks of most of phobos, this is
arguably a permance-blocker.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 21 2013
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10864


Denis Shelomovskij <verylonglogin.reg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |verylonglogin.reg gmail.com


--- Comment #1 from Denis Shelomovskij <verylonglogin.reg gmail.com> 2013-09-30
01:39:04 MSD ---
We can create a single  trusted `impl*` function and then call it from main
one. Then e.g. make a fake call to stuff wich defines  safe-ness to get right
attributes.

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