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 8696647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:19:23+00:00 2026-06-13T01:19:23+00:00

I have function to read image file az byte array. Performance analisys gives to

  • 0

I have function to read image file az byte array.
Performance analisys gives to me interesting facts.
I have check if file exists and then read as byte array.
File.exists spent 69.7% of time in function ?????
Open read and close spent only 30,3% of time.

I cant’t explaint to mysefl why?

Is this depend on something or it is default behaviour?

If this check is always slow – may be better approach is to open file without check for existing. And of cource use catch to solve case with missing file.

UPDATE:
Files are stored in internal SD card. More than 20000 files.
When test with 30 files percent is reduced to 23%.

  • 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-13T01:19:25+00:00Added an answer on June 13, 2026 at 1:19 am

    Finally I’m using file open without check ‘exists’. Working with files I have to catch exceptions – so my code security isn’t compromised.

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

Sidebar

Related Questions

I have a function which extracts a file into a byte array (data). int
I have a simple file read and write function. private void WriteToFile(String filename, String
I have code which uses the StreamReader to read HTML from a file, then
Ok, so I have a function that takes the path to an image file
Hi I have a raw dump of image which i store as byte array
I just don't get it. I have a function to read stemmed strings from
I have a function that calls out a read or write request on a
i have this function pymssql.connect(host=my host,user=my user,password=my pass,database=mydb) I want to read the user
I have read about dynamically loading your class files when needed in a function
I am using IMoniker::BindToObject function, and I have read the article on MSDN. The

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.