Warp - very fast & powerful networking library

just curious and i just did some benchmark here with impressive results.



Screenshot 2024-01-22 082338

pcall have more massive performance over task.spawn (upto 18x faster) here, very weird right where task.spawn supposed to be faster. i might implement pcall and replace task.spawn if there no other issues with using pcall

1 Like

But pcall and task.spawn arenā€™t equivalent

task.spawn(function() 
    task.wait(1)
    print("B")
end)
print("A")

-- A
-- (one second)
-- B
pcall(function()
    task.wait(1)
    print("B")
end)
print("A")

-- (one second)
-- B
-- A
4 Likes

Found a bug!

If you do this on the client:

Warp.Client(remoteName):Connect(func)

Without the identifier remoteName being created on the server, this function never runs due to the Serdes module repeatedly waiting. This also yields the entire script, which Iā€™m sure is unintentional behavior.

indeed it requires to create it on server first to receive rate limit configuration. so its not a bug

added new benchmark

sdjfnldjfnsdjigronethisok

But is yielding the entire script intentional behavior?

not all just the next line

ex:

-- this doing something and dont effect to the bottom yields.

Warp.Client(remoteName):Connect(func) -- yield/wait

-- next lines wont be runned until the yield finish

like ur using task.wait

1 Like

Iā€™m not sure why this happens. What is the reasoning behind that decision?

I mean, if the remote isnā€™t ready to connect or fire yet, Iā€™d expect that to be explictly handled with a Promise, for example.

promises is slow and its the rule where if the identifier not ready being used then u cant.

I got a idea you should add logging and a option to use a thingy ā€˜GetClientEventā€™ and ā€˜GetServerEventā€™ to connect a event since it will probably be easier to use idk

dont u can just do .Server(ā€œeventNameā€):Connect(fn)?

Your docs link is misleading/not working

Github page link is incorrect (leads to a 404 website)

The Github repo link is invalid.

somehow my account just got locked down for suspicious activity login so i unlocked it back, the link will restored soon

Edit: my account flagged as spam, i already contacted to github support. hopefully accepted.

2 Likes

Hey There!
I made a function called FIresWithDistance
^ ā€“ Fires data from server to all clients within a given distance

To use it
add this line of code in your types module script

FiresWithDistance: (self: Server, reliable: boolean, position : Vector3, Distance : number, any) -> (),

should look like this


Now Head to the Index module script located under server

and add this line of code

function getDistance(pos: Vector3, distance: number)
	local playersInRange = {}

	for _, player in ipairs(Players:GetPlayers()) do
		local character = player.Character
		if character and character:FindFirstChild('Humanoid') then
			local primaryPart = character.PrimaryPart
			if primaryPart then
				local playerPosition = primaryPart.Position
				local playerDistance = (pos - playerPosition).Magnitude

				if playerDistance < distance then
					table.insert(playersInRange, player)
				end
			end
		end
	end

	return playersInRange
end


function Server:FiresWithDistance(reliable: boolean, position : Vector3, Distance : number, ...: any)
	local PlayersInRange = getDistance(position, Distance)
	for _, player: Player in ipairs(PlayersInRange) do
		ServerProcess.insertQueue(self.id, reliable, player, ...)
	end
end

Example of usage

Warp.Server("Test"):Connect(function(Player : Player)
	
	
	local Position = Vector3.zero
	local Distance = 500
	local DataToSend = {
		"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
	}
	Warp.Server("Test"):FiresWithDistance(false,Position,Distance,DataToSend)
	
end)

and if your reading this @Eternity_Devs add this to the next update :pray:t6:

documentation & my github repos cant be reached (due flagged account status) so for temporary you can just download with just .RBXM file or use wally package instead, and if you need a help can contact me by reply post/me or private message.

why is your github account flagged?

no idea, wake up with this.

This text will be blurred

suggestion could you add a LogTraffic function