Skip to content

Similarity comparison on Frontend or Backend ? For optimum performance #145

Answered by vladmandic
uzair004 asked this question in Q&A
Discussion options

You must be logged in to vote

As NodeJS is single-threaded I don't want one user to hog entire process

NodeJS is single-threaded, but you can use a preinitialized pool of worker processes and
send each request to worker with currently lowest load

See demo/nodejs/node-multiproces.js and demo/nodejs/node-multiprocess-worker.js for example

That way you can even say to user 'you're number xx in the queue` without ever blocking the server or the response to the client

Json file may have huge amount of data (hundreds of images processed) sending them to Frontend may impact performance of website, i.e rendering UI, or possible hung up browser.

In theory, you could break down compare operation so server only finds rough m…

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
3 replies
@uzair004
Comment options

@vladmandic
Comment options

@uzair004
Comment options

Answer selected by uzair004
Comment options

You must be logged in to vote
4 replies
@vladmandic
Comment options

@uzair004
Comment options

@xemle
Comment options

@uzair004
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants