Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8165823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:39:24+00:00 2026-06-06T19:39:24+00:00

I have a server reading inbound newline-delimited strings. The pipeline looks like this: …

  • 0

I have a server reading inbound newline-delimited strings. The pipeline looks like this:

    ...
    pipeline.addLast("framer",
        new DelimiterBasedFrameDecoder(65535, Delimiters.lineDelimiter()));

    // plain old strings
    pipeline.addLast("decoder", new StringDecoder());

    // callback to handler
    pipeline.addLast("handler", new ConnectorHandler(collector));
    ...

When I change the decoder to the following:

    pipeline.addLast("framer", 
        new DelimiterBasedFrameDecoder(65535, 
            new ChannelBuffer[] { ChannelBuffers.wrappedBuffer(
                new byte[] {'\n'})})); 

I get a 3-4X increase in server speed. I don’t understand why this would be the case. The inbound strings vary betweeen about 1K-4K in length, around 10K strings/sec. Looking at the source code, it appears that it cycles through all the delimiters to find the one yielding the minimum frame length — by inspection, I don’t see how looking for only one delimiter would result in such a performance gain over looking for two delimiters. I am tempted to try to write my own decoder but I would like to understand what’s going on here. Any insight would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T19:39:25+00:00Added an answer on June 6, 2026 at 7:39 pm

    thats exactly the case.. looking only for one is much more cheap.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been testing the performance of reading server socket input stream. I found
we have to application servers, both reading from the same JMS server, preferably from
I have a server application which sends some xor encrypted strings . I am
thanks for reading this. I was wondering if I have some simple authentication system
This is basically the picture: I have a server and a client (operating through
I am reading Sql server book and i read FIRST_VALUE() and LAST_VALUE() this function.
I have this server running LightHTTPD. I am trying access MySQL/PHPMyAdmin on this server.
I have a client-server Silverlight application, which is use Socets. I have server appliaction
I'm working within a platform that I do not have server side access to
My server have default php version of 4, so when I run some script

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.