Skip to content

Use 'ShortText' as internal representation of PackageName #3913

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 30, 2016

Conversation

hvr
Copy link
Member

@hvr hvr commented Sep 29, 2016

No description provided.

-- Invalid data will be decoded as the replacement character (@U+FFFD@)
--
-- See also 'encodeStringUtf8'
decodeStringUtf8 :: [Word8] -> String
Copy link
Collaborator

@phadej phadej Sep 29, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could this leave somewhere in .Utils. or Compat``? I'll need exactly the same functions inparsec-parser` too

Copy link
Member Author

@hvr hvr Sep 29, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phadej I had to move it out of .Simple.Utils due to cyclic deps (and because non .Simple modules shall not depend on .Simple modules); I'm open to a new home for it... please suggest a concrete alternative place for those

Maybe simply introduce a non-exposed Distribution.Utils (which is partly reexported by Distribution.Simple.Utils)? Or we could just reexport {en,de}codeStringUtf8 in Distribution.Simple.Utils?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as I said on IRC, somewhere out of the D.Simple, as parsec is outside too.

Copy link
Member

@23Skidoo 23Skidoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bikeshedding: I'd move Distribution.ShortText to Distribution.Utils.ShortText. And I guess we can create Distribution.Utils.String for decodeStringUtf8.

@hvr hvr force-pushed the pr/pkgname-shorttext branch from 96d7249 to 6281ba9 Compare September 29, 2016 20:09
@23Skidoo
Copy link
Member

Looks good, let's merge once it's green!

@hvr hvr force-pushed the pr/pkgname-shorttext branch from 6281ba9 to 65d4df0 Compare September 29, 2016 21:26
@BardurArantsson BardurArantsson merged commit 4c96e80 into haskell:master Sep 30, 2016
@hvr
Copy link
Member Author

hvr commented Sep 30, 2016

Just for the record: cabal info zzz +RTS -s before this patch

cabal.0: There is no package named 'zzz'.
You may need to run 'cabal update' to get the latest list of available
packages.
     958,149,400 bytes allocated in the heap
     486,587,248 bytes copied during GC
      44,009,784 bytes maximum residency (19 sample(s))
         959,168 bytes maximum slop
             122 MB total memory in use (0 MB lost due to fragmentation)

                                     Tot time (elapsed)  Avg pause  Max pause
  Gen  0      1802 colls,     0 par    0.290s   0.290s     0.0002s    0.0009s
  Gen  1        19 colls,     0 par    0.231s   0.231s     0.0122s    0.0518s

  TASKS: 4 (1 bound, 3 peak workers (3 total), using -N1)

  SPARKS: 0 (0 converted, 0 overflowed, 0 dud, 0 GC'd, 0 fizzled)

  INIT    time    0.001s  (  0.001s elapsed)
  MUT     time    0.516s  (  0.812s elapsed)
  GC      time    0.521s  (  0.521s elapsed)
  EXIT    time    0.004s  (  0.004s elapsed)
  Total   time    1.044s  (  1.338s elapsed)

  Alloc rate    1,855,307,269 bytes per MUT second

  Productivity  50.0% of total user, 39.0% of total elapsed

gc_alloc_block_sync: 0
whitehole_spin: 0
gen[0].sync: 0
gen[1].sync: 0

after this patch:

cabal.1: There is no package named 'zzz'.
You may need to run 'cabal update' to get the latest list of available
packages.
     858,495,280 bytes allocated in the heap
     455,890,816 bytes copied during GC
      41,306,624 bytes maximum residency (19 sample(s))
       1,427,064 bytes maximum slop
             105 MB total memory in use (0 MB lost due to fragmentation)

                                     Tot time (elapsed)  Avg pause  Max pause
  Gen  0      1612 colls,     0 par    0.257s   0.256s     0.0002s    0.0006s
  Gen  1        19 colls,     0 par    0.231s   0.231s     0.0121s    0.0546s

  TASKS: 4 (1 bound, 3 peak workers (3 total), using -N1)

  SPARKS: 0 (0 converted, 0 overflowed, 0 dud, 0 GC'd, 0 fizzled)

  INIT    time    0.001s  (  0.001s elapsed)
  MUT     time    0.427s  (  0.781s elapsed)
  GC      time    0.487s  (  0.487s elapsed)
  EXIT    time    0.004s  (  0.004s elapsed)
  Total   time    0.921s  (  1.273s elapsed)

  Alloc rate    2,008,686,163 bytes per MUT second

  Productivity  47.0% of total user, 34.0% of total elapsed

gc_alloc_block_sync: 0
whitehole_spin: 0
gen[0].sync: 0
gen[1].sync: 0

@hvr hvr deleted the pr/pkgname-shorttext branch September 30, 2016 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants