Skip to content

Performance Issue in CycleTLS with Node.js Compared to Go #407

@NabiKAZ

Description

@NabiKAZ

Description

I noticed a strange slowdown in CycleTLS performance!

I was using Node.js at first and thought the issue was due to my proxies being slow — which seemed normal.
But later, when I tried the Go version, I realized it was much faster.

I know that CycleTLS uses a WebSocket connection between Node.js and Go internally,
but even considering that, such a significant delay shouldn’t exist.

At first, I thought maybe the problem was with my target site,
but I tested it with Google and got the same results.
The thing is, when sites like Google are fast, this difference might not be noticeable.
But when you test with a proxy that has, say, a 5-second delay,
the difference becomes very clear.

I wrote identical code for both Node.js and Go and tested them under the same conditions.
Pay attention to the duration of each request — I highlighted it in blue.
I used a relatively slow proxy.

  • On my target site, in Go, the first request takes 4921ms (including setup), and the following ones are around 1500ms.
  • But in Node.js, the first request takes 5439ms, and all the following requests stay around the same range!
    It seems every request includes the initial setup, which is inefficient.
    → That’s roughly a 260% performance drop!

A similar pattern occurs with Google:

  • In Go, the first request is 1003ms and the rest are about 600ms,
  • But in Node.js, all of them stay around 1000ms — again including the setup time.
    → That’s about a 60% slowdown here as well.

This issue becomes particularly important when using an infinite loop to continuously check a website.

Attached are screenshots showing the request timings for both Node.js and Go.

Image Image

Issue Type

Bug

Operating System

Windows 10

Node Version

Node 22.x

Golang Version

Other

Relevant Log Output

Metadata

Metadata

Assignees

Labels

triageThis ticket will be looked at shortly

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions