unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* more advanced bytevector => supervectors
@ 2021-09-02 15:45 Stefan Israelsson Tampe
  2021-09-02 15:54 ` Stefan Israelsson Tampe
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Stefan Israelsson Tampe @ 2021-09-02 15:45 UTC (permalink / raw)
  To: guile-devel

[-- Attachment #1: Type: text/plain, Size: 2196 bytes --]

Hi guilers!

My next project is to explore a more advanced bytevector structure than
today's bytevectors.
I think that having this infrastructure in guile and core code taken
advantage of it like having strings otop of it and allowing our string
library to use those (the difficult case is probably to get regexps working
properly)

Anyhow this is my initial comment in the code:

#|
The idea of this data structure is to note that when we employ full
large datastructure scans we can allow for a much more rich and featurefull
datastructure then a simple bytevector. The reason is that we can divide
the data in byte chunks and spend most of the time scanning copying maping
those areas with usual methis, even optimized C - code taken advantage of
advanced cpu opcodes are possible here. ANd by dividing it in chunks we get
a lot of new features with essentiually no cose with more than complexity
which we manage mostly in scheme. We gain many things,

1. Many new features that can vary on the pages

2. less memory hogs as
   a. it can use copy ion write semantics
   b. it does not need to fins 1GB continuous blocks

3. potentially faster operations as we can fast foorward the zeroe on write
   pages compared to pure bytevectors

4. we can allow for swaping and refferential datastructures to speed up
copying
   even further

5. can get better fiber features of C programs that spends seconds or
minutes on
   performing an operation because it will just spend a microsecond or such
   in C-land and then swap back to Scheme. CTRL-C will also work nicely.

6. We could potentially build a string library untop of these
datastructures and
   also we could add features to pages that lead to a much richer
interface.

7. resizing is much faster end efficient

8. reversing is super quick

9. queues and stacks of byte data can have a very efficient implementations

Drawback:
1. More complex as we need to consider boudaries
2. Slower one off operations like bytevector-u8-get as guile compiles the
   core operatoins to quite effective JIT CPU encodings. But maybe we can
   disign some caching to make those operations much faster and even have
   suporting JIT operations.

|#

WDYT ?

[-- Attachment #2: Type: text/html, Size: 2492 bytes --]

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

end of thread, other threads:[~2021-09-15  0:12 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-02 15:45 more advanced bytevector => supervectors Stefan Israelsson Tampe
2021-09-02 15:54 ` Stefan Israelsson Tampe
2021-09-06  2:10   ` Stefan Israelsson Tampe
2021-09-02 19:11 ` Matt Wette
2021-09-02 19:47   ` tomas
2021-09-08  2:04 ` Stefan Israelsson Tampe
2021-09-08  7:18   ` lloda
2021-09-08 11:32     ` Stefan Israelsson Tampe
2021-09-11 17:03     ` Stefan Israelsson Tampe
2021-09-11 18:21       ` lloda
2021-09-15  0:12 ` Stefan Israelsson Tampe

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).