flat assembler
Message board for the users of flat assembler.
Index
> Windows > Windows PROC at 7FFE0300h Goto page Previous 1, 2, 3 Next |
Author |
|
f0dder 06 Nov 2009, 17:50
Azu: in other words, you can't come up with any APIs where even modeswitching overhead is a speed problem?
_________________ - carpe noctem |
|||
06 Nov 2009, 17:50 |
|
Azu 06 Nov 2009, 17:56
Er.. all of them except the IO ones?
|
|||
06 Nov 2009, 17:56 |
|
Azu 06 Nov 2009, 18:18
GetTickCount(why why hell is this even a function)
memcpy(why why hell is this even a function) Sleep ReadProcessMemory |
|||
06 Nov 2009, 18:18 |
|
f0dder 06 Nov 2009, 18:23
GetTickCount() doesn't incur a modeswitch, Sleep() has milisecond granularity (whereas modeswitch overhead should be measured in, what, microsecends, even on the slowest CPUs), and memcpy doesn't do modeswitching either.
Why shouldn't GetTickCount() be a function? It's not replaceable by RDTSC, for a number of reasons... I guess you could have made a system tick counter with finer granularity and range and put it in globally mapped read-only memory at a fixed location, but considering how many applications would have use for that... it would have been overkill Also, why shouldn't memcpy be a function? While this isn't being done right now, it does allow for the system to decide on optimal routine at runtime depending on CPU features, alignment of buffers and size. For most code, it doesn't matter anyway, and if you have specific needs, you aren't going to be using a generic memcpy anyway. ReadProcessMemory, ho humm... page remapping and TLB overhead et cetera, I doubt modeswitch overhead has a lot of runtime cost. Besides, when would you be running RPM in time-critical code? |
|||
06 Nov 2009, 18:23 |
|
Azu 06 Nov 2009, 18:30
f0dder wrote: GetTickCount() doesn't incur a modeswitch f0dder wrote: Sleep() has milisecond granularity f0dder wrote: memcpy doesn't do modeswitching either. f0dder wrote: WriteProcessMemory, ho humm... page remapping and TLB overhead et cetera, I doubt modeswitch overhead has a lot of runtime cost. Besides, when would you be running WPM in time-critical code? |
|||
06 Nov 2009, 18:30 |
|
revolution 06 Nov 2009, 18:37
f0dder wrote: Sleep() has milisecond granularity |
|||
06 Nov 2009, 18:37 |
|
Azu 06 Nov 2009, 18:38
revolution wrote:
omfg |
|||
06 Nov 2009, 18:38 |
|
f0dder 06 Nov 2009, 18:47
Azu wrote: I'm not sure what you mean by modeswitch. I was talking about the overhead of reading a variable from some far away memory location, waiting for that read to complete, calling the result, and then returning. If you meant something else please explain. Azu wrote:
Azu wrote:
Azu wrote: Why do we even have page tables and translation tables? Total waste of silicon. What's wrong with just making code address independent and ditching all that useless bloat??? |
|||
06 Nov 2009, 18:47 |
|
Azu 06 Nov 2009, 18:53
f0dder wrote:
f0dder wrote:
f0dder wrote: ]quote="Azu"] f0dder wrote:
|
|||
06 Nov 2009, 18:53 |
|
Borsuc 06 Nov 2009, 19:22
@Azu: are you talking about virtual memory? Without it we wouldn't be able to multi-task.
And yeah Sleep sucks so bad with imprecision, I cannot imagine why they chose so though. |
|||
06 Nov 2009, 19:22 |
|
f0dder 06 Nov 2009, 19:31
Azu wrote:
You can get better Sleep() precision by doing timeBeginPeriod()... but if you need that, you should probably be using the multimedia timers instead. Understand your platform, and use the APIs that fit your needs Azu wrote:
Ring switching is (relatively) slow because of all the access checks incurred... but you aren't going to be doing ring switching just to execute a few instructions in kernel-mode unless you're a really bad OS designer, or juts plain out of your mind. Azu wrote: Can't they find a way to do that without all this bloated abstraction? If not, they should find a way to do without it, IMHO.. like maybe write secure code that isn't full of buffer overflows. |
|||
06 Nov 2009, 19:31 |
|
Borsuc 06 Nov 2009, 19:35
You say that Windows isn't a real-time system, but is there any reason why the hell it is so imprecise? Other than just arbitrarily so?
_________________ Previously known as The_Grey_Beast |
|||
06 Nov 2009, 19:35 |
|
Azu 06 Nov 2009, 19:56
Borsuc wrote: @Azu: are you talking about virtual memory? Without it we wouldn't be able to multi-task. Borsuc wrote: And yeah Sleep sucks so bad with imprecision, I cannot imagine why they chose so though. I plan to eventually make a JIT header for all my programs that sniffs those out at runtime and substitute them throughout my code, but I really shouldn't have to do that just to have decent performance. f0dder wrote:
f0dder wrote: You can get better Sleep() precision by doing timeBeginPeriod()... but if you need that, you should probably be using the multimedia timers instead. Understand your platform, and use the APIs that fit your needs Not according to MSDN. Their documentation for it says "timer resolution, in milliseconds"!! f0dder wrote:
f0dder wrote: Ring switching is (relatively) slow because of all the access checks incurred... but you aren't going to be doing ring switching just to execute a few instructions in kernel-mode unless you're a really bad OS designer, or juts plain out of your mind. f0dder wrote:
Even x86 is pretty high level. We should be able to programmatically redefine which micro-operations an opcode performs. Borsuc wrote: You say that Windows isn't a real-time system, but is there any reason why the hell it is so imprecise? Other than just arbitrarily so? Because to 99.99999% of everyone it doesn't matter how much is sucks as long as new $5000 computers can run it at all, apparently. |
|||
06 Nov 2009, 19:56 |
|
Borsuc 07 Nov 2009, 01:22
Are you joking? How can C++ be one of the most high-level languages?
I'm assuming you don't actually know truly HLL languages, as C is one of the most low-level available. C++ obviously is not as low-level, but it's built on the same base and CAN be (no one forces you to use the object-oriented abstractions). _________________ Previously known as The_Grey_Beast |
|||
07 Nov 2009, 01:22 |
|
Azu 07 Nov 2009, 01:26
Borsuc wrote: Are you joking? How can C++ be one of the most high-level languages? Borsuc wrote: I'm assuming you don't actually know truly HLL languages, as C is one of the most low-level available. C++ obviously is not as low-level, but it's built on the same base and CAN be (no one forces you to use the object-oriented abstractions). |
|||
07 Nov 2009, 01:26 |
|
f0dder 07 Nov 2009, 01:26
Borsuc wrote: You say that Windows isn't a real-time system, but is there any reason why the hell it is so imprecise? Other than just arbitrarily so? Azu wrote: Why not? If you make your code address independent it should run without without that bloat. Azu wrote:
Azu wrote:
Azu wrote:
Azu wrote:
Azu wrote: Even x86 is pretty high level. We should be able to programmatically redefine which micro-operations an opcode performs. Azu wrote:
Now, it's all fine living in an ivory tower and claiming that everything should be perfect... but in the real world, less than perfect works, and works pretty well. |
|||
07 Nov 2009, 01:26 |
|
Azu 07 Nov 2009, 01:36
[quote="PIZZA!!!1111111111111111111111111111!!!11111111111111111111111111111111111111111111111111111111111"]
f0dder wrote:
Borsuc wrote:
Borsuc wrote:
Anyways the point is an OS should be made in a way that it's efficient to begin with rather then programmers having to do hacky stuff to make it work right. Borsuc wrote:
Borsuc wrote:
Borsuc wrote:
Borsuc wrote:
Borsuc wrote:
Borsuc wrote: Now, it's all fine living in an ivory tower and claiming that everything should be perfect... but in the real world, less than perfect works, and works pretty well. |
|||
07 Nov 2009, 01:36 |
|
Borsuc 07 Nov 2009, 01:48
Azu wrote: Because it's even higher than C.. Name one language lower than C (which is abstracted from the processor obviously). C-- doesn't count. _________________ Previously known as The_Grey_Beast |
|||
07 Nov 2009, 01:48 |
|
Azu 07 Nov 2009, 01:53
Borsuc wrote:
Borsuc wrote: Name one language lower than C (which is abstracted from the processor obviously). C-- doesn't count. And below that, machine code (x86), which is still abstracted from the processor (processor is really RISC and runs uops). |
|||
07 Nov 2009, 01:53 |
|
Goto page Previous 1, 2, 3 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.