dinosaure / buffet

7 stars 1 forks source link

Talk about interface #1

Open dinosaure opened 6 years ago

dinosaure commented 6 years ago

Idea behind buffet is to provide a safe interface to manipulate buffer (string, bytes and bigstring). buffet has different levels about interface:

I'm currently on a new implementation of Buffet2 which use polymorphic variant. Then, we need to do some benchmark to compare them and see which is the best:

If you have any advise, I will happy to discuss about that (@hannesm, @samoht, @cfcs, @let-def, @Drup).

Drup commented 6 years ago

What's the goal here ? Do you really want to be able to get values that can be dynamically be string/bytes/bigstrings, or do you want to be able to write your encoding/decoding algorithms on various structures easily ?

The current version is ridiculously full of indirections, to the point where you will seriously hurt performances. Using module abstractions, with various signatures that correspond to the various features, would allow you to keep indirections to a minimum.

dinosaure commented 6 years ago

I would like to have an abstraction between bigstring/string and bytes and choose which one I use it dynamically. This is the main purpose of this library where sometimes I would like to use string instead bigstring.

I agree about indirection and the bottleneck is about the dispatch between kind of buffers.

It seems interesting to provide Buffet3 feature (slice) directly over Buffet0 and implement capabilities with polymorphic variants over Buffet0 too.

I will try to provide signatures for each feature and see what happen.

dinosaure commented 5 years ago

We can more precisely talk about performances issues with benchmark/benchmark.ml now and bechamel. I will make some tests step by step and print results here.