Thread overview
[Issue 5036] New: Remove caching from ranges
Oct 10, 2010
Tomasz Sowiński
Oct 10, 2010
Tomasz Sowiński
Feb 26, 2013
Tomasz Sowiński
October 10, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=5036

           Summary: Remove caching from ranges
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody@puremagic.com
        ReportedBy: tomeksowi@gmail.com


--- Comment #0 from Tomasz Sowiński <tomeksowi@gmail.com> 2010-10-10 14:38:28 PDT ---
All higher-order ranges in Phobos should not cache their element values. Such known ranges are: std.algorithm.Map and std.range.Sequence.

A Cached range should be introduced to make up for the loss.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 10, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=5036


Tomasz Sowiński <tomeksowi@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|nobody@puremagic.com        |andrei@metalanguage.com


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 26, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=5036



--- Comment #1 from Andrei Alexandrescu <andrei@erdani.com> 2013-02-26 08:56:37 PST ---
Hm, I think things are fine as they are, though I agree with the consistency argument. Agree to close?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 26, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=5036



--- Comment #2 from Tomasz Sowiński <tomeksowi@gmail.com> 2013-02-26 12:28:04 PST ---
The argument was the least about consistency, I recall caching got in the way
when the mapped to element was:
- used <= 1 times
- trivial to calculate (faster than read/write)
- manually allocated (harder to anticipate destruction)

Plus, front/back vs. opIndex poses problems of their own.

Why the obligation to cache?

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