GithubHelp home page GithubHelp logo

flod's People

Contributors

epi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

flod's Issues

Add basic benchmark

E.g. test performance of byLine vs. File.byLine(); or write an example parser and test its performance vs. existing equivalent in C.

Consider changing signatures/semantics of peek and alloc

  • peek and alloc could accept a reference to the buffer, just like reallocate in allocator API.

This means that element type must be defined explicitly in peek sink or alloc source, either literally or by using templates to agree with peek source's or alloc sink's expected types.
Question: This could also make writing an efficient FallbackBuffer easier, couldn't it?

Define semantics of alloc() precisely

Semantics of Buffer.alloc() and Stage.alloc() is not scritly
defined yet.
Buffer should use bool alloc(ref T[], size_t)
so that e.g. FallbackBuffer is possible.
Stage should probably just throw when it's unable to fulfill
the request. Or maybe it should return false and give the
largest buffer it can at the moment, and let the source decide.

Bring back step()

An active source with step can be wrapped like this:
Sink(AdapterSource(Source(AdapterSink)))
or Sink(AdapterSource(Source(ItsSource, AdapterSink)))

  1. Sink calls pull or peek on AdapterSource
  2. AdapterSource calls step(n) on Source, where n is a hint on how many elements are to be written to AdapterSink. (TODO: should n be just a hint or an exact required number?)
  3. Step calls alloc/commit or push on AdapterSink.
  4. AdapterSource gets data from AdapterSink and passes them to Sink.

Implement flod.buffer.InSituBuffer and FallbackBuffer

InSituBuffer has a fixed-size (set at compile time) buffer inside it.
alloc() may move data on wrap
FallbackBuffer contains two buffers and uses the first one until it fails to alloc() the requested size. FallbackBuffer then tries to alloc() using the other buffer and moves the data to it, if successful.

Change alloc/commit api

  • alloc always returns the buffer capable of holding at least the requested number of elements. TODO: decide if it should throw or return null/false if it can't provide such buffer.
  • commit returns a size_t that should == the requested number of elements. Returning a smaller number means that everything is ok, but the sink is not interested in reading more data.
    Write errors (including broken pipe or disk full) should cause an exception to be thrown.

Implement byChunk - a range that instantiates a pipeline and reads from it by chunk.

Call byChunk() without arguments if you don't care about the size of a chunk and you're able to process chunks of any size.
Call byChunk(size_t chunkSize) if you require chunks of specific size.
Call byChunk(T)(T[] buf) if you require chunks of specific size and you want to manage the buffer where they'll be stored.

byChunk should implement input range interface as well as opApply() iteration.
byChunk should be optimized according to the pipeline's last stage source method and required chunk size and buffer ownership.

Implement constraint checkers.

Initial experiments with @satisfies made it look promising.
Without verbose constraint checkers it is next to impossible to find what's wrong in stage's code.
Before doing anything else, current traits should be extended with constraint checkers.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.