Ro-Photoshop [Fastest Image Editor & Drawing Module] (Parallel)

I want to clear something up about OSGL’s and CanvasDraw’s performance numbers. I totally get that lower - end devices can struggle, but when I tested this myself, I noticed something interesting:

  • For OSGL, your example place gave me the same results you mentioned - around 100 FPS at rest, and ~3 while rendering.
  • For OSGL, when I wrote the code from scratch, (same setup: 512x512 circles on 1024x1024, drawing on mouse hold), my FPS sat at a solid 240 when idle, only dropping to ~100 during rendering.

A similar occurrence happened while testing with CanvasDraw.

OSGL Testing Code

--!optimize 2

--[[
OSGL Render Benchmark (v1.6b) - Circle Stress Test
==================================================
Tests single-threaded rendering performance by drawing
512x512 circles at mouse position while pressed.

Test Parameters:
• Resolution:  1024x1024
• Draw Call:   512x512 circle (filled)
• Condition:   While mouse button is down
• Thread:      Single (main thread only)

==================================================
]]

-- Wait a delay of 5s, in-case any Roblox services interfere. 
task.wait(5)

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")

local Public = ReplicatedStorage.Public
local OSGL = require(Public.OSGL)

local Window = OSGL.Window
local Color = OSGL.color

local RED = Color.RED

local Player = Players.LocalPlayer
assert(Player)

local PlayerGui = Player.PlayerGui
local Screen = PlayerGui:WaitForChild("Screen")
local Canvas = Screen.Canvas

local WIDTH, HEIGHT = 1024, 1024

local program = Window.from(Canvas, WIDTH, HEIGHT):Unwrap()

while task.wait() do
    local inWindow, X, Y = program:GetRelativeMousePosition(Canvas)
    if inWindow and UserInputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) then
        program:Circle(X, Y, 512, RED)
        program:Render()
    end
end

OSGL Circle Performance Stress Test.rbxl (80.2 KB)

Honest question - what’s going on in your implementation that’s tanking performance at rest ? Mine idles at cap until you start drawing.

Results

– Idle: [Roblox Cap]
– Drawing: ~100FPS

CanvasDraw Testing code

--!optimize 2

--[[
CanvasDraw Render Benchmark (4.14.0) - Circle Stress Test
==================================================
Tests single-threaded rendering performance by drawing
512x512 circles at mouse position while pressed.

Test Parameters:
• Resolution:  1024x1024
• Draw Call:   512x512 circle (filled)
• Condition:   While mouse button is down
• Thread:      Single (main thread only)

==================================================
]]

-- Wait a delay of 5s, in-case any Roblox services interfere. 
task.wait(5)

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")

local Public = ReplicatedStorage.Public
local CD = require(Public.CanvasDraw)

local Player = Players.LocalPlayer
assert(Player)

local PlayerGui = Player.PlayerGui
local Screen = PlayerGui:WaitForChild("Screen")
local Canvas = Screen.Canvas

local WIDTH, HEIGHT = 1024, 1024

local program = CD.new(Canvas, Vector2.new(WIDTH, HEIGHT))
program.AutoRender = true

local RED = Color3.fromRGB(255, 0, 0)

while task.wait() do
    local inWindow = program:MouseIsOnTop()
    if inWindow and UserInputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) then
        local XY = program:GetMousePoint()
        program:DrawCircle(XY, 512, RED)
    end
end

Once again, CanvasDraw yields similar numbers to OSGL, yet vastly different to yours.

Results

– Idle: 120FPS
– Drawing: 30 - 50FPS

CanvasDraw Circle Performance Stress Test.rbxl (131.5 KB)

Both RBXMs have been provided. Please could you provide yours? I’m genuinely curious (and I’m sure @Ethanthegrand14 would also be) why 100FPS is seemingly lost? I apologise if any of this came across as rude, but I want to understand how you got this result. It is clear that Ro-Photoshop is faster than both CanvasDraw and OSGL - and I’m not debating that. By default both libraries are single-threaded, whilst you support numerous threads, so it’s clear that you will yield higher performance. Perhaps run it on 1 thread so we can compare performance that way? If mine, as well as those “6+ devices” all yielded 3FPS or so while rendering a circle, it seems that possibly there may be something wrong with your code. Yet again, my aim is not to publicly degrade you, nor your library, I simply want to understand what’s happening behind the scenes here.

These were tested in a public game - My personal account does not have access to the EditableImage API and so I used a friends place. Feel free to publish these and try it in the real Roblox client. The difference between Studio & the Roblox client shouldn’t make that large of a performance difference, however.

3 Likes