Uploaded image for project: 'C++ Standard Library'
  1. C++ Standard Library
  2. STDCXX-914

sstream ctors inefficient in reentrant modes

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Critical
    • Resolution: Unresolved
    • 4.1.2, 4.1.3, 4.1.4, 4.2.0, 4.2.1
    • 4.2.2
    • 27. Input/Output
    • None
    • Inefficiency

    Description

      As discussed in this thread stream ctors in thread-safe builds are inefficient due to the initialization of the mutex data member in every stream, even in those that never use it. As soon as binary compatibility rules permit it we should remove the mutex and/or defer its initialization until it's needed. It might be possible to implement the deferred initialization as early as 4.2.2, or maybe 4.3. Complete removal will need to wait until 5.0.

      Attachments

        1. stdcxx-914-gprof-gcc-4.1.2-12D.txt
          13 kB
          Martin Sebor
        2. stdcxx-914-gprof-gcc-4.3.0-12S.txt
          62 kB
          Martin Sebor

        Activity

          People

            sebor Martin Sebor
            sebor Martin Sebor
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 12h
                12h
                Remaining:
                Time Spent - 2.5h Remaining Estimate - 9.5h
                9.5h
                Logged:
                Time Spent - 2.5h Remaining Estimate - 9.5h
                2.5h