From 17854663dec9a868e0e90354e563d50e39de9b82 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 7 Mar 2023 09:23:09 +0000 Subject: [PATCH] vfs: log size of File and Dir in tests for optimization --- vfs/dir_test.go | 5 +++++ vfs/file_test.go | 5 +++++ 2 files changed, 10 insertions(+) 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{})) +}