Question How fast does my system create file? - Using Process Monitor Sysinternals

Oblivion77

Honorable
Jul 6, 2018
238
2
10,585
Hello everyone

I would like to know, from when I press “Save” in MS Paint, when has my system created the whole PNG-file the first time? Regardless of it is in the CPU or memory.

I have used Process Monitor Sysinternals, to try getting a more detailed overview. I have uploaded the screen of my results: https://ibb.co/547f4XT


1: MS Paint is being commanded to save the file

My guess, when the file has been created the first time, is one of following points:

2: File becomes PNG format

3: MS.Paint: CreateFile – succes

4: First time file is being closed

5: Explorer.EXE: CreateFile – unsuccesful

6: First time EndOfFile is being mentioned in Details

7: No more processes in MS Paint

8: Explorer.EXE process is done and close file



Thank you reading and replying

Best regards

Emil
 

kanewolf

Titan
Moderator
Hello everyone

I would like to know, from when I press “Save” in MS Paint, when has my system created the whole PNG-file the first time? Regardless of it is in the CPU or memory.

I have used Process Monitor Sysinternals, to try getting a more detailed overview. I have uploaded the screen of my results: https://ibb.co/547f4XT


1: MS Paint is being commanded to save the file

My guess, when the file has been created the first time, is one of following points:

2: File becomes PNG format

3: MS.Paint: CreateFile – succes

4: First time file is being closed

5: Explorer.EXE: CreateFile – unsuccesful

6: First time EndOfFile is being mentioned in Details

7: No more processes in MS Paint

8: Explorer.EXE process is done and close file



Thank you reading and replying

Best regards

Emil
That doesn't tell you how fast the "system" does it, that tells you how fast MS Paint does it.
What are you trying to benchmark?

My interpretation of your screen shot is that MS Paint doesn't even START writing the file until the very bottom of the shot, below your #8.
 

Oblivion77

Honorable
Jul 6, 2018
238
2
10,585
That doesn't tell you how fast the "system" does it, that tells you how fast MS Paint does it.
What are you trying to benchmark?

My interpretation of your screen shot is that MS Paint doesn't even START writing the file until the very bottom of the shot, below your #8.
I would just like to know, how many millisecons / time it takes from I press "Save" until the file has been fully created. Regardless of in which hardware part.
 

USAFRet

Titan
Moderator
I would just like to know, how many millisecons / time it takes from I press "Save" until the file has been fully created. Regardless of in which hardware part.
Lots of factors come into play.

System specs
Specific drive it is being written to
Size , complexity, resolution of the png
What else is the system doing at that moment
Which version of MS Paint

If it takes "200ms", is that good or bad? What are we actually trying to know here?
 

Oblivion77

Honorable
Jul 6, 2018
238
2
10,585
Lots of factors come into play.

System specs
Specific drive it is being written to
Size , complexity, resolution of the png
What else is the system doing at that moment
Which version of MS Paint

If it takes "200ms", is that good or bad? What are we actually trying to know here?
There is no benchmark or "great score".

But how can I find out? Not by using Sysinternals?
 

kanewolf

Titan
Moderator
There is no benchmark or "great score".

But how can I find out? Not by using Sysinternals?
Generally you would have purposely written benchmark code. And then you would run 1000 or 10,000 creates with various other things happening on the system. The time will be different if a backup is running, or a download is happening, for example.
But even then, you don't know FOR SURE your file is on disk. Why, because the disk "lies". It has cache that it uses to tell the system "I'm done" when it really isn't. If nanoseconds on a file creation time are important, then you will have to do a lot more work.
 

Oblivion77

Honorable
Jul 6, 2018
238
2
10,585
Generally you would have purposely written benchmark code. And then you would run 1000 or 10,000 creates with various other things happening on the system. The time will be different if a backup is running, or a download is happening, for example.
But even then, you don't know FOR SURE your file is on disk. Why, because the disk "lies". It has cache that it uses to tell the system "I'm done" when it really isn't. If nanoseconds on a file creation time are important, then you will have to do a lot more work.
Yes, others told me also, that it can take several seconds before the file has been written to disk, because of the factors you just wrote. That is why, that I wrote regardsless of hardware part, no has to be written to disk.

I would just like to find out if it takes 0,1 or like 0,01 second, in that factor.

What other software can I use to monitor the proces? None of the data in Sysinternals tells me what I would like to know?
 
Yes, others told me also, that it can take several seconds before the file has been written to disk, because of the factors you just wrote. That is why, that I wrote regardsless of hardware part, no has to be written to disk.

I would just like to find out if it takes 0,1 or like 0,01 second, in that factor.

What other software can I use to monitor the proces? None of the data in Sysinternals tells me what I would like to know?
"Regardless of hardware" to me means there's no time factor here. There's only "how much code has to be run to do the job."
 

kanewolf

Titan
Moderator

Oblivion77

Honorable
Jul 6, 2018
238
2
10,585
Everything happens in RAM. That file exists in RAM not in the CPU, assuming it is larger than a few bytes.
Have you ever read any documents on how I/O is done in a PC ?? Something like this -- https://www.cs.uic.edu/~jbell/CourseNotes/OperatingSystems/13_IOSystems.html
Thank you for clarifying that the file is assembled / created first time in memory.
And yes, it larger than af few bytes.

No, I have not conducted extensive research in the topic.

But any ideas or software, that can tell me, when the file has been created / assembled (what term is the right one by the way?) in memory after pressing "Save"?

Thank you again
 

USAFRet

Titan
Moderator
Thank you for clarifying that the file is assembled / created first time in memory.
And yes, it larger than af few bytes.

No, I have not conducted extensive research in the topic.

But any ideas or software, that can tell me, when the file has been created / assembled (what term is the right one by the way?) in memory after pressing "Save"?

Thank you again
This depends on what you mean by "created".

Written to RAM? nanoseconds.
And actually, continuously. Make a change to it, written to RAM.

Clicking "Save" would be writing to some semipermanent storage device. Your HDD or SSD.
But not really...it is initially written to the drive cache. Only later does it actually exist as a "file" on the drive. Later could be milliseconds later, or even minutes later.
 

kanewolf

Titan
Moderator
Thank you for clarifying that the file is assembled / created first time in memory.
And yes, it larger than af few bytes.

No, I have not conducted extensive research in the topic.

But any ideas or software, that can tell me, when the file has been created / assembled (what term is the right one by the way?) in memory after pressing "Save"?

Thank you again
It exists in RAM the entire time. Every pixel in your JPG file is represented in RAM. If you draw a yellow line on a blank canvas in Paint, each pixel you turned yellow has to be represented in RAM. That representation is then converted to the output format you pick. Generally in RAM also. That new buffer is then sent to the I/O subsystem.
You really need to start with a basic understanding of how I/O works in a computer.
 

Oblivion77

Honorable
Jul 6, 2018
238
2
10,585
Open MS Paint
A blank canvas opens up, which has not been assigned any file-format
Press save
The "Save as" window appears - where you can choose a file format
Choose a format and file name and press "Save"

Then a I/O process between CPU and memory happens, yes?

And then the file is being assembled in the memory, but after how long, how can I find out?
 

USAFRet

Titan
Moderator
That "I/O process" already happened.
Just opening Paint, and then every change to that canvas...all continuously written to RAM.

Indeed, every mouse movement, every click, is continuously written to RAM. And different levels of ram. L1, L2, L3...
Nanoseconds.

It is already "assembled" in RAM (memory).
 

Oblivion77

Honorable
Jul 6, 2018
238
2
10,585
That "I/O process" already happened.
Just opening Paint, and then every change to that canvas...all continuously written to RAM.

Indeed, every mouse movement, every click, is continuously written to RAM. And different levels of ram. L1, L2, L3...
Nanoseconds.

It is already "assembled" in RAM (memory).
When I pick the PNG-format in the "Save as" window and save the file, a new process creates the PNG-file with all its chunks etc. and the PNG-file is being assembled in memory. So the I/O process has not happend yet.