Jump to content




Terminal Benchmark 1.0 - Term API performance tested

api computer lua

11 replies to this topic

#1 CrazedProgrammer

  • Members
  • 495 posts
  • LocationWageningen, The Netherlands

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:
Posted Image
Command computer native terminal:
Posted Image
8x6 color monitor:
Posted Image

Share your scores!

Edited by CrazedProgrammer, 15 July 2016 - 11:14 PM.


#2 Pyuu

  • Members
  • 203 posts

Posted 20 February 2016 - 11:25 PM

Wouldn't this program be very dependent on what Minecraft is doing in the background?

#3 Creator

    Mad Dash Victor

  • Members
  • 2,168 posts
  • LocationYou will never find me, muhahahahahaha

Posted 20 February 2016 - 11:33 PM

There is a similar program hiding on the forums. Something with benchmark.

#4 Pyuu

  • Members
  • 203 posts

Posted 21 February 2016 - 12:24 AM

Even if this program is similar, it's still an interesting utility.

#5 HPWebcamAble

  • Members
  • 933 posts
  • LocationWeb Development

Posted 21 February 2016 - 02:13 AM

View PostMayushii, on 20 February 2016 - 11:25 PM, said:

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.

#6 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

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)?

#7 CrazedProgrammer

  • Members
  • 495 posts
  • LocationWageningen, The Netherlands

Posted 21 February 2016 - 03:53 PM

View PostBomb Bloke, on 21 February 2016 - 12:16 PM, said:

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 by CrazedProgrammer, 21 February 2016 - 03:57 PM.


#8 Waitdev_

  • Members
  • 432 posts
  • LocationAdelaide

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

#9 CrazedProgrammer

  • Members
  • 495 posts
  • LocationWageningen, The Netherlands

Posted 22 February 2016 - 09:32 AM

View PostWaitdev_, on 22 February 2016 - 08:06 AM, said:

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?

#10 Waitdev_

  • Members
  • 432 posts
  • LocationAdelaide

Posted 22 February 2016 - 09:36 AM

View PostCrazedProgrammer, on 22 February 2016 - 09:32 AM, said:

View PostWaitdev_, on 22 February 2016 - 08:06 AM, said:

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 by Waitdev_, 22 February 2016 - 09:42 AM.


#11 CrazedProgrammer

  • Members
  • 495 posts
  • LocationWageningen, The Netherlands

Posted 22 February 2016 - 09:56 AM

View PostWaitdev_, on 22 February 2016 - 09:36 AM, said:

View PostCrazedProgrammer, on 22 February 2016 - 09:32 AM, said:

View PostWaitdev_, on 22 February 2016 - 08:06 AM, said:

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.

#12 funniray10

  • Members
  • 10 posts

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?





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users