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

  • Home
  • SEARCH
  • 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 6600945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:41:23+00:00 2026-05-25T18:41:23+00:00

I have to craft a data processor able to process more than 2.5MB/s of

  • 0

I have to craft a data processor able to process more than 2.5MB/s of input from STDIN, and output a number to STDOUT. What is faster, to use a BufferedReader and then conversions to data types or a Scanner and nextInt() or nextFloat()?

EMPIRICAL TEST RESULTS: BufferedReader and conversion is a little bit faster, but nothing too significant.

Thankyou!

  • 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-05-25T18:41:23+00:00Added an answer on May 25, 2026 at 6:41 pm

    The answer is most likely that it doesn’t matter which way you do it from a performance perspective. (And there’s no way that someone can type at 2.5Mb per second at the console!)

    If you include everything that goes on at the OS level and elsewhere when reading from the console, orders of magnitude more CPU cycles will be expended in getting the bytes from the user typing at the console than are spent parsing the characters. If you are reading from a file (via stdin), we are no longer talking orders of magnitude difference, but I’d still be surprised if the two approaches were significantly different … overall.

    But the best thing you can do is try it out. It shouldn’t take more than a few minutes to write a benchmark that roughly approximates to what you are doing, and see which alternative is faster … and by how much. (Make sure that you measure total elapsed time, not just user-space CPU time for the Java application.)

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

Sidebar

Related Questions

Have you determined a maximum number of characters allowed in FCKEditor ? I seem
Have you refactored from an ActiveRecord to a DataMapper pattern? What conditions prompted the
I have a function (exercise 10.11 in Thompson's The Craft of Functional Programming )
I have been tasked with returning a negative selection from our sql database. I'll
Newbie to .NET data apps here, coming from a Visual Foxpro background. I'm planning
This might be trivial for some of you, but I have two screenshots from
I have a CSV file and want to generate dumps of the data for
I have a stored proc that takes an input of xml value like this:
Suppose I have a search for government registered charities, how can I craft my
I have a file of data fields, which may contain comments, like below: id,

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.