databricks-cli/libs/filer
Renaud Hartert 235973e7b1
[Fix] Do not buffer files in memory when downloading (#1599)
## Changes

This PR fixes a performance bug that led downloaded files (e.g. with
`databricks fs cp dbfs:/Volumes/.../somefile .`) to be buffered in
memory before being written.

Results from profiling the download of a ~100MB file:

Before:
```
Type: alloc_space
Showing nodes accounting for 374.02MB, 98.50% of 379.74MB total
```

After:
```
Type: alloc_space
Showing nodes accounting for 3748.67kB, 100% of 3748.67kB total
```

Note that this fix is temporary. A longer term solution should be to use
the API provided by the Go SDK rather than making an HTTP request
directly from the CLI.

fix #1575 

## Tests

Verified that the CLI properly download the file when doing the
profiling.
2024-07-17 07:14:02 +00:00
..
dbfs_client.go Upgraded Go version to 1.21 (#664) 2023-08-15 13:50:40 +00:00
filer.go Correctly overwrite local state if remote state is newer (#1008) 2023-11-24 11:15:46 +00:00
files_client.go [Fix] Do not buffer files in memory when downloading (#1599) 2024-07-17 07:14:02 +00:00
fs.go Add fs.FS adapter for the filer interface (#422) 2023-06-02 12:49:59 +00:00
fs_test.go Add implementation of filer.Filer for local filesystem (#460) 2023-06-12 15:53:58 +02:00
local_client.go Update error checks that use the `os` package to use `errors.Is` (#1461) 2024-06-03 12:39:36 +00:00
local_root_path.go Remove unnecessary `filepath.FromSlash` calls (#1458) 2024-05-29 15:30:26 +00:00
local_root_path_test.go Make local files default for fs commands (#506) 2023-06-23 16:07:09 +02:00
slice.go Upgraded Go version to 1.21 (#664) 2023-08-15 13:50:40 +00:00
slice_test.go Abstract over file handling with WSFS or DBFS through filer interface (#135) 2022-12-14 15:37:14 +01:00
workspace_files_client.go Move bespoke status call to main workspace files filer (#1570) 2024-07-05 11:32:29 +00:00
workspace_files_client_test.go Move bespoke status call to main workspace files filer (#1570) 2024-07-05 11:32:29 +00:00
workspace_files_extensions_client.go Move bespoke status call to main workspace files filer (#1570) 2024-07-05 11:32:29 +00:00
workspace_root_path.go Make local files default for fs commands (#506) 2023-06-23 16:07:09 +02:00
workspace_root_path_test.go Make local files default for fs commands (#506) 2023-06-23 16:07:09 +02:00