0

I'm using iOS in front end to upload the image by using the following encode script,

    Ti.Utils.base64encode(get_image);

In back end i'm using the following script to decode the image in Rails.

    Base64.decode64(encrypted_image)

Now, this is working fine in Local ENV. (Time taken to upload 10sec). Now the problem is the same script takes 30seconds in Production ENV.

How to optimize this?

sasikkumar
  • 216
  • 2
  • 11
  • How big is the image? What kind of service do you use? Is it a REST service where you POST the image? I don't believe the performance killer is encoding/decoding base64. But the question is, why you encode/decode and not just send the image binary? – hgoebl Nov 19 '13 at 22:27
  • The maximum image size is upto 2 MB. Using HTTP CLIENT to post image from device to server. I tried to upload image without encoding but it takes more time to upload compare with sending encoded image. – sasikkumar Nov 20 '13 at 05:27
  • Don't know how compression changes this, but Base64 encoding add 1/3 of size to your image, so I believe you will loose time encoding the image. Have a look at the differences in network between ENV and PROD. – hgoebl Nov 20 '13 at 07:38

0 Answers0