Important: please be mindful who you share this with, this might give the wrong impression and/or bad ideas to some people. This is not meant to bash CC, it is merely the result of me testing bandwidth use when re-evaluating the call-limits on OC's GPUs and needing something to compare to. It is not meant to imply CC should behave differently. It is useful to explain why OC's screens may be comparatively sluggish in certain use-cases.
Note: if you saw this before this update, beware: I changed the methology a little, to get closer to the actual worst cases. Instead of generating a random string to reuse, a random string is now generated for each print operation. This makes for a more random overall text buffer content, leading to worse compression.
res = component and component.gpu.getResolution or term.getSize
set = component and function(x,y,str) component.gpu.set(x, y, str) end or function(x,y,str) term.setCursorPos(x,y) term.write(str) end
cs = component and {0xFFFFFF, 0xFFCC33, 0xCC66CC, 0x6699FF,0xFFFF33, 0x33CC33, 0xFF6699, 0x333333,0xCCCCCC, 0x336699, 0x9933CC, 0x333399,0x663300, 0x336600, 0xFF3333, 0x000000} or {1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768}
sbg = component and component.gpu.setBackground or term.setBackgroundColor
sfg = component and component.gpu.setForeground or term.setTextColor
sleep = sleep or os.sleep
chars = [[abcdefghijklmnopqrstuvwABCDEFGHIJKLMNOPQRSTUVW0123456789`~!@#$%^&*()-_=+[{]};:'"\|,<.>/?]]
function rstr(len)
local str = ""
while #str < len do
local idx = math.random(#chars)
str = str .. chars:sub(idx, idx)
end
return str
end
- OpenComputers 1.4.3
- Three tiers, for each CPU+GPU+Screen of matching tier, maximum supported resolution.
- ComputerCraft 1.64
- Normal and advanced monitors, largest monitor size, smallest text scale.
- Each test was given enough time to update every "pixel" at least once, as well as to provide some "burn in time" (e.g. allow JIT to optimize stuff).
- Bandwidth usage measurements taken with NetLimiter 4.
- There's a
sleep(0)
in all of the loops, which is to allow breaking out of the loop in OC without having to restart the computer, and avoids running intotoo long without yielding
errors in CC. - Server and client both ran in dev-env, results may vary in normal MC and/or when using custom servers.
- The measured values are the upload of the server with a single client connected. Multiply these numbers with the number of nearby players to get an idea of a realistic worst case.
Idle |
---|
Min: ~2.5KB/s |
Max: ~2.75KB/s |
Keep calling print
with single characters.
do
while true do
local str = rstr(1)
print(str)
sleep(0)
end
end
OC Tier 1 | OC Tier 2 | OC Tier 3 | CC |
---|---|---|---|
Min: ~5.2KB/s | Min: ~5.1KB/s | Min: ~4.4KB/s | Min: ~30KB/s |
Max: ~5.5KB/s | Max: ~5.3KB/s | Max: ~5.1KB/s | Max: ~31KB/s |
Keep calling print
with text that is one line long.
do
local w, h = res()
while true do
local str = rstr(w - 1)
print(str)
sleep(0)
end
end
OC Tier 1 | OC Tier 2 | OC Tier 3 | CC |
---|---|---|---|
Min: ~7.1KB/s | Min: ~8.5KB/s | Min: ~13KB/s | Min: ~238KB/s |
Max: ~8.0KB/s | Max: ~9.2KB/s | Max: ~14KB/s | Max: ~250KB/s |
Keep calling io.write
with single characters.
do
while true do
local str = rstr(1)
io.write(str)
sleep(0)
end
end
OC Tier 1 | OC Tier 2 | OC Tier 3 | CC |
---|---|---|---|
Min: ~4.5KB/s | Min: ~5.3KB/s | Min: ~4.8KB/s | Min: ~268KB/s |
Max: ~5.5KB/s | Max: ~6.9KB/s | Max: ~5.2KB/s | Max: ~282KB/s |
Manually print 10 character long strings at random locations.
do
local w, h = res()
while true do
local str = rstr(10)
local x, y = math.random(w), math.random(h)
set(x, y, str)
sleep(0)
end
end
OC Tier 1 | OC Tier 2 | OC Tier 3 | CC |
---|---|---|---|
Min: ~4.8KB/s | Min: ~4.8KB/s | Min: ~4.7KB/s | Min: ~270KB/s |
Max: ~5.3KB/s | Max: ~5.3KB/s | Max: ~5.3KB/s | Max: ~280KB/s |
Keep calling print
with text that is one line long, setting background and foreground to a random value each time.
do
local w, h = res()
while true do
local str = rstr(w - 1)
local bg, fg = math.random(#cs), math.random(#cs)
sbg(cs[bg])
sfg(cs[fg])
print(str)
sleep(0)
end
end
OC Tier 1 | OC Tier 2 | OC Tier 3 | CC Adv. |
---|---|---|---|
Min: ~7.3KB/s | Min: ~9.5KB/s | Min: ~12KB/s | Min: ~246KB/s |
Max: ~8.5KB/s | Max: ~10KB/s | Max: ~13KB/s | Max: ~249KB/s |
Manually print single characters at random locations, setting background and foreground to a random value each time.
do
local w, h = res()
while true do
local str = rstr(1)
local x, y = math.random(w), math.random(h)
local bg, fg = math.random(#cs), math.random(#cs)
sbg(cs[bg])
sfg(cs[fg])
set(x, y, str)
sleep(0)
end
end
OC Tier 1 | OC Tier 2 | OC Tier 3 | CC Adv. |
---|---|---|---|
Min: ~6.1KB/s | Min: ~5.2KB/s | Min: ~5.3KB/s | Min: ~570KB/s |
Max: ~6.7KB/s | Max: ~6.0KB/s | Max: ~6.4KB/s | Max: ~600KB/s |
Fill the screen, one character at a time, setting background and foreground to a random value each time, sleeping outside the inner loop.
do
local w, h = res()
while true do
for y = 1, h do for x = 1, w do
local str = rstr(1)
local bg, fg = math.random(#cs), math.random(#cs)
sbg(cs[bg])
sfg(cs[fg])
set(x, y, str)
end end
sleep(0)
end
end
OC Tier 1 | OC Tier 2 | OC Tier 3 | CC Adv. |
---|---|---|---|
Min: ~6.5KB/s | Min: ~9.6KB/s | Min: ~18KB/s | Min: ~587KB/s |
Max: ~7.2KB/s | Max: ~10KB/s | Max: ~19KB/s | Max: ~590KB/s |