Ticket #1473 (new bug)

Opened 6 years ago

Last modified 4 months ago

isSpace is too slow

Reported by: igloo Owned by:
Priority: normal Milestone: _|_
Component: libraries/base Version: 6.6.1
Keywords: Cc: gwern0@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

In the thread starting  http://www.haskell.org/pipermail/glasgow-haskell-users/2007-May/012608.html Neil Mitchell compares the speed is isSpace to C's functions:

C's isspace: 0.375
C's iswspace: 0.400
Char.isSpace: 0.672

The thread contains some discussions of possible solutions.

Attachments

space.hs Download (11.1 KB) - added by guest 3 years ago.
the criterion module with the variant implementations gspace', gspace, gspace
first-run.txt Download (21.9 KB) - added by guest 3 years ago.
first benchmark attempt; subsequent issues and incompleteness addressed in later runs
second-run.txt Download (19.5 KB) - added by guest 3 years ago.
third-run.txt Download (24.6 KB) - added by guest 3 years ago.
fourth-run.txt Download (29.2 KB) - added by guest 3 years ago.
fifth-run.txt Download (29.5 KB) - added by guest 3 years ago.

Change History

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 5 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple

Changed 4 years ago by guest

  • cc gwern0@… added

Changed 3 years ago by guest

  • failure set to None/Unknown

Improving isSpace is going to be difficult. I've done some Criterion benchmarking of the suggested optimizations, and for most of them, the benefit is modest. This may reflect improved optimization in GHC 6.10.2.

However, there is a small improvement in gspace' and gspace''' as compared to gspace, so that might be worth doing?

Changed 3 years ago by guest

the criterion module with the variant implementations gspace', gspace, gspace

Changed 3 years ago by guest

first benchmark attempt; subsequent issues and incompleteness addressed in later runs

Changed 3 years ago by guest

Changed 3 years ago by guest

Changed 3 years ago by guest

Changed 3 years ago by guest

Changed 3 years ago by guest

(As with  http://hackage.haskell.org/trac/ghc/ticket/2143, the Shakespeare data file is downloaded from  http://www.gutenberg.org/etext/100 )

Changed 4 months ago by morabbin

Worth redoing the experiment for 7.6.1?

Note: See TracTickets for help on using tickets.