简体   繁体   中英

Javascript processing in browser or more processing server side

I currently have a web app using the google maps api. The app runs fine yet its abit laggy. Would it be more efficient doing more of the processing on the server and have loads more ajax requests or would trying to optimise the javascript be the way to go?

-------------EDIT-----------

The target device is a pi.

Basically the only computations is an map of colour : coordinated that gets looped over and then a map of x:y coordinates

So nutting majour. would it be better doing the loop client side or setting a timeout to do a request every say 100ms?

您可以使用 socket.io 处理您需要的信息,然后使用 websockets 而不是 ajax 请求将其实时发送到客户端。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM