This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
CrazedProgrammer's profile picture

Terminal Benchmark 1.0 - Term API performance tested

Started by CrazedProgrammer, 20 February 2016 - 09:30 PM
CrazedProgrammer #1
Posted 20 February 2016 - 10:30 PM
Does your graphically intensive program suffer from lag?
If your program suffers from lag, you might be calling the Term API functions too many times.
This program will test how long the most important Term API functions take to complete their task.
It will repeatedly run the functions for 5 seconds in steps of 1000 and calculate
the amount of microseconds it takes for a single function to complete.
If you want your program to run at a locked 20fps, it should take way less than 50000µs per frame to draw the program.
This can also be used as a benchmark for how well your computer handles ComputerCraft.

This program is compatible with all screens (black and white supported).
The minimal suggested resolution is 51x12, otherwise the text might cut off.

Download:

pastebin get 97H5d5hZ tbm

Run it with:

tbm
If you want to use term.native():

tbm n
If you want to use it on a monitor:
(Replace <side> with "left", "right", "top", "bottom", "front" or "back")

monitor <side> tbm

"term.write 1" means term.write with one character.
"term.write 50" means term.write with 50 characters.

Screenshots / my results:
Command computer terminal:

Command computer native terminal:

8x6 color monitor:


Share your scores!
Edited on 15 July 2016 - 10:14 PM
Pyuu #2
Posted 20 February 2016 - 11:25 PM
Wouldn't this program be very dependent on what Minecraft is doing in the background?
Creator #3
Posted 20 February 2016 - 11:33 PM
There is a similar program hiding on the forums. Something with benchmark.
Pyuu #4
Posted 21 February 2016 - 12:24 AM
Even if this program is similar, it's still an interesting utility.
HPWebcamAble #5
Posted 21 February 2016 - 02:13 AM
Wouldn't this program be very dependent on what Minecraft is doing in the background?

I doubt it. But you can always try running it a few times.
Bomb Bloke #6
Posted 21 February 2016 - 12:16 PM
A suggestion, perhaps check if the current terminal has a setVisible() function (eg "if term.current().setVisible then"), and if so, perform tests for both states (or maybe just ask which state to use)?
CrazedProgrammer #7
Posted 21 February 2016 - 03:53 PM
A suggestion, perhaps check if the current terminal has a setVisible() function (eg "if term.current().setVisible then"), and if so, perform tests for both states (or maybe just ask which state to use)?
Good suggestion!
That's interesting since it won't draw to the parent terminal/window.
I'll add it in version 1.1 with
tbm i
Also, I should fix the term.write and term.blit benchmarks because they don't restore to location (1,1) so they draw outside of the screen :P/>
I'm going on vacation for 5 days so it'll be around a week until I release version 1.1.

Also, post your benchmarks people!
(I want to feel special with my 3 year old i5 3570K OC 4.2GHz :P/>)
(I know I suck at life)
Edited on 21 February 2016 - 02:57 PM
Waitdev_ #8
Posted 22 February 2016 - 08:06 AM
can you add a line to show the total of all of them? also, awesome program idea :3
CrazedProgrammer #9
Posted 22 February 2016 - 09:32 AM
can you add a line to show the total of all of them? also, awesome program idea :3
Thanks!
Would it be better to have a "benchmark score" instead of the sum of all functions?
Waitdev_ #10
Posted 22 February 2016 - 09:36 AM
can you add a line to show the total of all of them? also, awesome program idea :3
Thanks!
Would it be better to have a "benchmark score" instead of the sum of all functions?
yeah, that would be nice :)/>

also, in the "k" part, is higher better?
Edited on 22 February 2016 - 08:42 AM
CrazedProgrammer #11
Posted 22 February 2016 - 09:56 AM
can you add a line to show the total of all of them? also, awesome program idea :3
Thanks!
Would it be better to have a "benchmark score" instead of the sum of all functions?
yeah, that would be nice :)/>

also, in the "k" part, is higher better?
Yes.
"k" means thousand.
funniray10 #12
Posted 24 February 2016 - 10:22 PM
could you make this like test how fast it can run funtions in your program, like fun api.writeAll("text") or something like that?