1

Currently, I serialize a large javascript object and post it to the server. This process takes to long. So, I would like to pass a javascript object from the client to the server via node.js/socket.io so the server can handle the workload. It seems that it does not work. Is this possible?

1
  • Should you? You are creating a security hole that can be easily exploited... Commented Dec 31, 2012 at 10:15

2 Answers 2

2

Where is the slowdown? If the performance issue is related to serialization, then you're faced with the same problem no matter how you communicate with the server - can't ship objects around without serializing them first.

(To send the object over socket.io, first serialize it, then send it across as a string)

Sign up to request clarification or add additional context in comments.

2 Comments

Yes, the issue is with serialization (performance hit on the browser causing users to wait until the serialization in complete). Currently, I serialize a large javascript object that is then posted to the server for processing. I was hoping that I could pass the entire object and do all the convertion/processing on the server allowing the users to continue on with other tasks. Is there another option?
Serialization means "prepare for transfer". No, if you're looking to transfer the object, you can't offload the work. Look at other methods for mitigating your problem - transferring sub-sections of the object when they change, caching some of the serialization work, and making the object smaller overall, are standard techniques.
1

Simple answer, No it is not possible. You are essentially message passing between two distinct systems. The fact that they are both javascript interpreters is irrelevant.

I would suggest serializing and passing parts of the object as changes occur.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.