Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. to copy or open.

to copy or open.

Scheduled Pinned Locked Moved C#
question
9 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Stephen Lintott
    wrote on last edited by
    #1

    This is more of a theoretical question that anything else. There is no way to simulate it(All results will differ from implementation to implementation) so here goes. What will be faster (The least amout of bytes). To download (Save) a file from a website or to open the file directly in the browser

    Stephen Lintott Bsc IT (RAU)

    M D L 3 Replies Last reply
    0
    • S Stephen Lintott

      This is more of a theoretical question that anything else. There is no way to simulate it(All results will differ from implementation to implementation) so here goes. What will be faster (The least amout of bytes). To download (Save) a file from a website or to open the file directly in the browser

      Stephen Lintott Bsc IT (RAU)

      M Offline
      M Offline
      musefan
      wrote on last edited by
      #2

      Well if you download an image or open directly in browser you would still need to stream the image, so the byte count for the image atleast will always be the same. As far as i know whenever an image is viewed in the browser it is downloaded to computer anyway. So surely its the same process.... just my thoughts, i may be wrong

      If only MySelf.Visible was more than just a getter... A person can produce over 5 times there own body weight in excrement each year... please re-read your questions before posting

      D 1 Reply Last reply
      0
      • S Stephen Lintott

        This is more of a theoretical question that anything else. There is no way to simulate it(All results will differ from implementation to implementation) so here goes. What will be faster (The least amout of bytes). To download (Save) a file from a website or to open the file directly in the browser

        Stephen Lintott Bsc IT (RAU)

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        There's no difference between the two processes. The file is downloaded into the browser cache either way.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008

        1 Reply Last reply
        0
        • M musefan

          Well if you download an image or open directly in browser you would still need to stream the image, so the byte count for the image atleast will always be the same. As far as i know whenever an image is viewed in the browser it is downloaded to computer anyway. So surely its the same process.... just my thoughts, i may be wrong

          If only MySelf.Visible was more than just a getter... A person can produce over 5 times there own body weight in excrement each year... please re-read your questions before posting

          D Offline
          D Offline
          Deresen
          wrote on last edited by
          #4

          You're right. If you save it, the byte stream will go to a place you have to assign. If you open it, you will save the picture in your cache. But if you want to open it I guess you also put it in your RAM, so I guess saving would be slightly quicker.

          D M 2 Replies Last reply
          0
          • D Deresen

            You're right. If you save it, the byte stream will go to a place you have to assign. If you open it, you will save the picture in your cache. But if you want to open it I guess you also put it in your RAM, so I guess saving would be slightly quicker.

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            Deresen wrote:

            But if you want to open it I guess you also put it in your RAM

            No, it won't, since there is no telling how big the file is and it could run the system out of memory, the file is written directly to disk, then the file is launched using the Shell. ...and the OP didn't say anything about a picture, but listed generically, "file".

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007, 2008

            D 1 Reply Last reply
            0
            • D Deresen

              You're right. If you save it, the byte stream will go to a place you have to assign. If you open it, you will save the picture in your cache. But if you want to open it I guess you also put it in your RAM, so I guess saving would be slightly quicker.

              M Offline
              M Offline
              musefan
              wrote on last edited by
              #6

              Thanks... its good to know i get things right sometimes :) I was thinking there would be extra work in the loading but as the OP asked about displaying in a browser i assumed the intent was to show it to the end user in which case he would be displaying after download anyway... but as, like in most cases, the OP is AWOL we shall prob never know their aim lol

              If only MySelf.Visible was more than just a getter... A person can produce over 5 times there own body weight in excrement each year... please re-read your questions before posting

              1 Reply Last reply
              0
              • S Stephen Lintott

                This is more of a theoretical question that anything else. There is no way to simulate it(All results will differ from implementation to implementation) so here goes. What will be faster (The least amout of bytes). To download (Save) a file from a website or to open the file directly in the browser

                Stephen Lintott Bsc IT (RAU)

                L Offline
                L Offline
                Luc Pattyn
                wrote on last edited by
                #7

                Hi, save=download+writeToFile open=download+writeToScreen Now what is faster depends on the complexity of the data. If it is simple HTML and a modern PC, showing it would typically be faster than writing it to disk; OTOH if it is a complex Excel file with lots of start-up macro's clearly writing to file would be faster since it does not require launching the app nor interpreting/executing the data. :)

                Luc Pattyn [Forum Guidelines] [My Articles]


                - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


                modified on Sunday, June 12, 2011 8:01 AM

                S 1 Reply Last reply
                0
                • D Dave Kreskowiak

                  Deresen wrote:

                  But if you want to open it I guess you also put it in your RAM

                  No, it won't, since there is no telling how big the file is and it could run the system out of memory, the file is written directly to disk, then the file is launched using the Shell. ...and the OP didn't say anything about a picture, but listed generically, "file".

                  A guide to posting questions on CodeProject[^]
                  Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                       2006, 2007, 2008

                  D Offline
                  D Offline
                  Deresen
                  wrote on last edited by
                  #8

                  That's true. And we assume it is a file. The file has to be downloaded, always, if you save it or if you show it. But if you show the file, the computer has to write the bits to the screen. This will cost time and possible more data which will stream to the ram.

                  1 Reply Last reply
                  0
                  • L Luc Pattyn

                    Hi, save=download+writeToFile open=download+writeToScreen Now what is faster depends on the complexity of the data. If it is simple HTML and a modern PC, showing it would typically be faster than writing it to disk; OTOH if it is a complex Excel file with lots of start-up macro's clearly writing to file would be faster since it does not require launching the app nor interpreting/executing the data. :)

                    Luc Pattyn [Forum Guidelines] [My Articles]


                    - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


                    modified on Sunday, June 12, 2011 8:01 AM

                    S Offline
                    S Offline
                    Stephen Lintott
                    wrote on last edited by
                    #9

                    Ok I get what your saying. But I did an experement with eathereal and saw that if you copy the file from a file server there is more chater on the network than if you open the file. I'm just wondering if the same applies to a download or open over the net.

                    Stephen Lintott Bsc IT (RAU)

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups