parse.com - Weighing Parse Objects - the 128kb Limit -


i want gauge how large parse objects ahead of time. have app lots of addunique , i'd have idea of how capacity addunique single parse object. i'd make sure don't bump or exceed limit.

this might of help. answer stack overflow question , appears address question. there lot of comments , info may in post well.

function roughsizeofobject( object ) {      var objectlist = [];     var stack = [ object ];     var bytes = 0;      while ( stack.length ) {         var value = stack.pop();          if ( typeof value === 'boolean' ) {             bytes += 4;         }         else if ( typeof value === 'string' ) {             bytes += value.length * 2;         }         else if ( typeof value === 'number' ) {             bytes += 8;         }         else if         (             typeof value === 'object'             && objectlist.indexof( value ) === -1         )         {             objectlist.push( value );              for( var in value ) {                 stack.push( value[ ] );             }         }     }     return bytes; } 

Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -