Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why ByteString is not Vector Word8?

Seems like strict ByteString is structuraly same as Vector Word8. Why ByteString is not deprecated in favor of Vector?

Are there performance examples when ByteString is faster than Vector Byte8?

like image 313
danbst Avatar asked Jul 01 '14 19:07

danbst


1 Answers

The vector-bytestring package is an attempt at doing exactly this:

type ByteString = Vector Word8

The goal of the author is to replace bytestring, but for now there are some performance regressions and it doesn't seem very active.

According to the author, the main reason for the performance regressions are that bytestring often uses mutation internally. vector-bytestring might have an advantage in some cases where stream fusion kicks in, but otherwise it may need to fall back to mutation to get comparable performance and it doesn't do that yet.

like image 192
GS - Apologise to Monica Avatar answered Nov 14 '22 10:11

GS - Apologise to Monica