From: moskewicz AT MEM DOT po DOT com Date: Sat, 15 Jun 1996 04:00:16 -0400 Message-Id: <9606150800.AA15815@mercury> To: Sengan DOT Short AT durham DOT ac DOT uk Cc: djgpp AT delorie DOT com Subject: Re: Are near pointers worth it? [Quotes edited for brevity.] [That is, I accidently leaned on the delete line key.] >>>> and VESA 2 linear frame buffers. If I were to use near pointers would >>>> it make it any faster? >> >>>I think not. I got about a 5% speedup of my putpixel() function from >>>using near pointers, and that is the absolute worst case becuase it >>>involves a segment load per pixel. If you are just setting the selector >> >> I would agree totally, using near pointers is not worth it. Remember, >> GCC >> doesn't touch %fs and %gs, so just put your selector there, and you only >> load it once. Just watch out for the _far* family, as they will clobber >> %fs > >Surely the point is that the access to video memory is so slow that large >variations in execution speed in the processor are masked by the wait states >enforced by the graphics cards. If (ever) some graphics card is introduced >which has the same access time as normal memory is introduced, it seems to me >that difference between the different ways of accessing memory will be clearer. Surely not! Profiling results for mode 4101h, 640x480 256 color. Running in 32 bit protected mode with linear framebuffer 1.0428s for 30000 lines => 28768.23 lines/s 1.4810s for 300 clears => 202.57 clears/s, 59.35 Mb/s 1.0628s for 150 bitBlts => 141.13 bitBlt/s, 41.35 Mb/s Baseline values: REP STOSD in system memory: 31.28 Mb/s REP MOVSD in system memory: 29.87 Mb/s No cache thrashing. Unless I am throughly confused, these numbers indicate that video memory access on my ATI mach64 2MB VRAM PCI card is faster than system DRAM access. This profile was produced by profile, from SciTech. It comes with a big list of various card/cpu profiles in a text file, ready to use as a reference... I just ignore people who say "My code draws 10^9 sprites per year, is that fast?" without mentioning their cpu or video card... :) >best for its solution: I might want a fast program accessing hardware really >fast, and not want memory protection for one application, and yet want memory >protection for another. Nah, near pointers are just no good, ever! :) Seriously, though, they have serious problems, and little benefit (but of course, I won't back that up). >Sengan ---- moskewicz AT mem DOT po DOT com