Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

vfs: log size of File and Dir in tests for optimization

Nick Craig-Wood17854663dec9
diff --git a/vfs/dir_test.go b/vfs/dir_test.go
index 788471eb7..c04144e86 100644
--- a/vfs/dir_test.go
+++ b/vfs/dir_test.go
@@ -7,6 +7,7 @@ import (
"sort"
"testing"
"time"
+ "unsafe"
"github.com/rclone/rclone/fs"
"github.com/rclone/rclone/fs/operations"
@@ -577,3 +578,7 @@ func TestDirRename(t *testing.T) {
err = dir.Rename("potato", "tuba", dir)
assert.Equal(t, EROFS, err)
}
+
+func TestDirStructSize(t *testing.T) {
+ t.Logf("Dir struct has size %d bytes", unsafe.Sizeof(Dir{}))
+}
diff --git a/vfs/file_test.go b/vfs/file_test.go
index c54be40d1..728d8c699 100644
--- a/vfs/file_test.go
+++ b/vfs/file_test.go
@@ -6,6 +6,7 @@ import (
"io"
"os"
"testing"
+ "unsafe"
"github.com/rclone/rclone/fs"
"github.com/rclone/rclone/fs/operations"
@@ -411,3 +412,7 @@ func TestFileRename(t *testing.T) {
})
}
}
+
+func TestFileStructSize(t *testing.T) {
+ t.Logf("File struct has size %d bytes", unsafe.Sizeof(File{}))
+}