Drawing a large circle in qbasic using pset takes much time but html or other such languages displays it immediately,why? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Drawing a large circle in qbasic using pset takes much time but html or other such languages displays it immediately,why?

11th Apr 2018, 6:35 AM
InnoFail
InnoFail - avatar
4 Answers
+ 2
PSET draws _one pixel at a time_ whereas a browser with HTML can read ahead and render things quicker with an optimised pipeline. It also runs natively, whereas Qbasic needs old hardware or virtualization to run -- both are slowdowns. Browsers can draw a circle with SVG (if you don't expressly draw each pixel). Browsers can use multiple threads and more cache because they are built for today's hardware. The Qbasic interpreter is not. It is a 16-bit application. As for other languages, they either have faster interpreters, compile the code (native machine language is much faster), or use JIT (just in time compiling is a middle ground for interpreters or virtual machines to speed up execution). Qbasic is very old (not to be confused with QB64). That you can even run it requires an ancient machine (slow down) or virtualization (slow down) like DosBox, built-in protected mode (if your system is old and still supports it), or a virtual machine running MS-DOS. If you like the QBasic language, use QB64 which is modern and includes new native commands for loading image files.
11th Apr 2018, 10:43 AM
non
+ 1
can't we increase the speed of pset in a qbasic as drawing large circle directly using circle keyword?
12th Apr 2018, 4:59 AM
InnoFail
InnoFail - avatar
+ 1
Yes. CIRCLE will draw almost instantly. For basic drawing, it's a better, but it only supports x, y, radius, colour. You cannot draw an oval as far as I recall and you cannot perform colour dithering on the edges.
12th Apr 2018, 7:52 AM
non
+ 1
Thanks
19th Apr 2018, 5:45 AM
InnoFail
InnoFail - avatar