public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/11723] New: ctype<wchar_t>::do_is(mask, wchar_t) is slow
@ 2003-07-30  9:15 peturr02 at ru dot is
  2003-07-30  9:19 ` [Bug libstdc++/11723] " peturr02 at ru dot is
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: peturr02 at ru dot is @ 2003-07-30  9:15 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11723

           Summary: ctype<wchar_t>::do_is(mask, wchar_t) is slow
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: peturr02 at ru dot is
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu

ctype<wchar_t> calls wctype every time iswctype is called. This makes
ctype<wchar_t> very slow.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/11723] ctype<wchar_t>::do_is(mask, wchar_t) is slow
  2003-07-30  9:15 [Bug libstdc++/11723] New: ctype<wchar_t>::do_is(mask, wchar_t) is slow peturr02 at ru dot is
@ 2003-07-30  9:19 ` peturr02 at ru dot is
  2003-08-04  2:29 ` pinskia at physics dot uc dot edu
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: peturr02 at ru dot is @ 2003-07-30  9:19 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11723



------- Additional Comments From peturr02 at ru dot is  2003-07-30 09:19 -------
Created an attachment (id=4521)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=4521&action=view)
Test case

Here are typical results:

time ./ctypeisspeed c 10000
0.14user 0.00system 0:00.15elapsed 98%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (85major+11minor)pagefaults 0swaps
time ./ctypeisspeed c++ 10000
5.34user 0.00system 0:05.35elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (85major+11minor)pagefaults 0swaps

So ctype<wchar_t>::is is more than 30x slower than iswctype.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/11723] ctype<wchar_t>::do_is(mask, wchar_t) is slow
  2003-07-30  9:15 [Bug libstdc++/11723] New: ctype<wchar_t>::do_is(mask, wchar_t) is slow peturr02 at ru dot is
  2003-07-30  9:19 ` [Bug libstdc++/11723] " peturr02 at ru dot is
@ 2003-08-04  2:29 ` pinskia at physics dot uc dot edu
  2003-08-23  1:02 ` dhazeghi at yahoo dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-08-04  2:29 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11723


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-08-04 02:29:06
               date|                            |


------- Additional Comments From pinskia at physics dot uc dot edu  2003-08-04 02:29 -------
I can confirm this on the mainline (20030803).
It looks like it does not scale (even cache):
tin:~/src/gnu/gcctest>time ./a.out c 10000
0.060u 0.000s 0:00.07 85.7%     0+0k 0+0io 197pf+0w
tin:~/src/gnu/gcctest>time ./a.out c++ 10000
1.600u 0.000s 0:01.61 99.3%     0+0k 0+0io 197pf+0w
tin:~/src/gnu/gcctest>time ./a.out c 100000
0.570u 0.000s 0:00.57 100.0%    0+0k 0+0io 197pf+0w
tin:~/src/gnu/gcctest>time ./a.out c++ 100000
15.990u 0.000s 0:15.99 100.0%   0+0k 0+0io 197pf+0w


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/11723] ctype<wchar_t>::do_is(mask, wchar_t) is slow
  2003-07-30  9:15 [Bug libstdc++/11723] New: ctype<wchar_t>::do_is(mask, wchar_t) is slow peturr02 at ru dot is
  2003-07-30  9:19 ` [Bug libstdc++/11723] " peturr02 at ru dot is
  2003-08-04  2:29 ` pinskia at physics dot uc dot edu
@ 2003-08-23  1:02 ` dhazeghi at yahoo dot com
  2003-10-06 16:43 ` bkoz at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dhazeghi at yahoo dot com @ 2003-08-23  1:02 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11723


dhazeghi at yahoo dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4                         |---


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/11723] ctype<wchar_t>::do_is(mask, wchar_t) is slow
  2003-07-30  9:15 [Bug libstdc++/11723] New: ctype<wchar_t>::do_is(mask, wchar_t) is slow peturr02 at ru dot is
                   ` (2 preceding siblings ...)
  2003-08-23  1:02 ` dhazeghi at yahoo dot com
@ 2003-10-06 16:43 ` bkoz at gcc dot gnu dot org
  2003-12-16 13:36 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2003-10-06 16:43 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11723


bkoz at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |bkoz at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED


------- Additional Comments From bkoz at gcc dot gnu dot org  2003-10-06 16:43 -------

Yes, I noticed this when implementing it.... would like to cache this stuff. 

Comparing to ctype<char> isn't especially helpful, since ctype<char> doesn't
have virtual functions (since the standard provides a specialization that
bypasses the virtuals). 

However, there has got to be a better way. 

-benjamin


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/11723] ctype<wchar_t>::do_is(mask, wchar_t) is slow
  2003-07-30  9:15 [Bug libstdc++/11723] New: ctype<wchar_t>::do_is(mask, wchar_t) is slow peturr02 at ru dot is
                   ` (3 preceding siblings ...)
  2003-10-06 16:43 ` bkoz at gcc dot gnu dot org
@ 2003-12-16 13:36 ` cvs-commit at gcc dot gnu dot org
  2003-12-16 13:48 ` paolo at gcc dot gnu dot org
  2003-12-16 13:49 ` paolo at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-12-16 13:36 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2003-12-16 11:00 -------
Subject: Bug 11723

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	paolo@gcc.gnu.org	2003-12-16 11:00:52

Modified files:
	libstdc++-v3   : ChangeLog 
	libstdc++-v3/include/bits: locale_facets.h 
	libstdc++-v3/testsuite/performance: narrow_widen_char.cc 
	                                    narrow_widen_wchar_t.cc 
	libstdc++-v3/config/locale/gnu: ctype_members.cc 
	libstdc++-v3/config/locale/generic: ctype_members.cc 
Added files:
	libstdc++-v3/testsuite/performance: is_wchar_t.cc 

Log message:
	2003-12-16  Paolo Carlini  <pcarlini@suse.de>
	
	PR libstdc++/11723
	* include/bits/locale_facets.h: Add _M_bit and _M_wmask,
	used to speed up the computation of ctype::do_is.
	* config/locale/generic/ctype_members.cc
	(_M_initialize_ctype): Fill _M_bit and _M_wmask.
	(ctype::do_is): Use _M_bit and _M_wmask.
	* config/locale/gnu/ctype_members.cc: Likewise.
	* testsuite/performance/is_wchar_t.cc: New.
	
	* testsuite/performance/narrow_widen_wchar_t.cc: Tweak
	string literal (incorrect citation ;)
	
	* include/bits/locale_facets.h: Minor tweaks, const
	correctness, unsigned -> size_t.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.2162&r2=1.2163
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/locale_facets.h.diff?cvsroot=gcc&r1=1.77&r2=1.78
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/performance/is_wchar_t.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/performance/narrow_widen_char.cc.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/performance/narrow_widen_wchar_t.cc.diff?cvsroot=gcc&r1=1.2&r2=1.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/config/locale/gnu/ctype_members.cc.diff?cvsroot=gcc&r1=1.15&r2=1.16
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/config/locale/generic/ctype_members.cc.diff?cvsroot=gcc&r1=1.10&r2=1.11



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11723


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/11723] ctype<wchar_t>::do_is(mask, wchar_t) is slow
  2003-07-30  9:15 [Bug libstdc++/11723] New: ctype<wchar_t>::do_is(mask, wchar_t) is slow peturr02 at ru dot is
                   ` (4 preceding siblings ...)
  2003-12-16 13:36 ` cvs-commit at gcc dot gnu dot org
@ 2003-12-16 13:48 ` paolo at gcc dot gnu dot org
  2003-12-16 13:49 ` paolo at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: paolo at gcc dot gnu dot org @ 2003-12-16 13:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From paolo at gcc dot gnu dot org  2003-12-16 13:31 -------
Committed a fix.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|bkoz at gcc dot gnu dot org |paolo at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11723


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/11723] ctype<wchar_t>::do_is(mask, wchar_t) is slow
  2003-07-30  9:15 [Bug libstdc++/11723] New: ctype<wchar_t>::do_is(mask, wchar_t) is slow peturr02 at ru dot is
                   ` (5 preceding siblings ...)
  2003-12-16 13:48 ` paolo at gcc dot gnu dot org
@ 2003-12-16 13:49 ` paolo at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: paolo at gcc dot gnu dot org @ 2003-12-16 13:49 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From paolo at gcc dot gnu dot org  2003-12-16 13:32 -------
Fixed for 3.4.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |3.4


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11723


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2003-12-16 13:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-30  9:15 [Bug libstdc++/11723] New: ctype<wchar_t>::do_is(mask, wchar_t) is slow peturr02 at ru dot is
2003-07-30  9:19 ` [Bug libstdc++/11723] " peturr02 at ru dot is
2003-08-04  2:29 ` pinskia at physics dot uc dot edu
2003-08-23  1:02 ` dhazeghi at yahoo dot com
2003-10-06 16:43 ` bkoz at gcc dot gnu dot org
2003-12-16 13:36 ` cvs-commit at gcc dot gnu dot org
2003-12-16 13:48 ` paolo at gcc dot gnu dot org
2003-12-16 13:49 ` paolo at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).