Giter Site home page Giter Site logo

Comments (2)

mgravell avatar mgravell commented on September 21, 2024

Looks broadly fine. I'd probably try to avoid dealing in lengths all the time, because in some edge cases this can cause catastrophic performance (usually when dealing with massively recursive models) - if you can deal in positions rather than lengths it may work better, but: in most cases (the ones not I volving massively recursive models) it won't matter. I can't see the parser code - note that for optimal performance you want to use a ref-counting "buffer reader" that tracks a span, rather than constantly accessing spans from the buffer. SE.Redis and protobuf-net both have examples of this that you may find useful.

from pipelines.sockets.unofficial.

Wraith2 avatar Wraith2 commented on September 21, 2024

Ok, thanks, that's good. I was worried about the looping with tasks. I'd normally approach this with a dedicated thread and events but that doesn't scale.

The parser implementation contains protocol details which are proprietary so I can't post that unfortunately. The protocol is pretty simple flat utf8 encoded with no nesting. The parser takes the sequence and attempts to pull apart each slice, I can show that part, I grab each segment span and attempt to consume it as far as possible skipping any known prefix so I avoid re-running a complex parse if possible.

I'm not sure what you mean with the lengths. The Message object returned by the parser will always start at offset 0 so length is both a length and a relative position, Which part would you change and what approach would be better?

I'll find and take a look at the SE.Redis code, that's probably closest to what I'm doing.

from pipelines.sockets.unofficial.

Related Issues (20)

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.