You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by gi...@git.apache.org on 2017/09/22 21:26:18 UTC

[GitHub] nickva commented on a change in pull request #835: Avoid decompressing just to calculate external size

nickva commented on a change in pull request #835: Avoid decompressing just to calculate external size
URL: https://github.com/apache/couchdb/pull/835#discussion_r140600280
 
 

 ##########
 File path: src/couch/src/couch_db_updater.erl
 ##########
 @@ -1079,14 +1079,13 @@ copy_docs(Db, #db{fd = DestFd} = NewDb, MixedInfos, Retry) ->
                 {Body, AttInfos} = copy_doc_attachments(Db, Sp, DestFd),
                 % In the future, we should figure out how to do this for
                 % upgrade purposes.
-                EJsonBody = case is_binary(Body) of
+                ExternalSize = case is_binary(Body) of
                     true ->
-                        couch_compress:decompress(Body);
+                        couch_compress:uncompressed_size(Body);
                     false ->
-                        Body
+                        ?term_size(Body)
 
 Review comment:
   @janl thought of that but noticed how in `decompress` there is an error for anything that's not an external term or snappy compression, so thought of keeping the same structure.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services