mirror of https://github.com/restic/restic.git
Reenable Preloading
This commit is contained in:
parent
f214dce87c
commit
a0fea201d9
|
@ -18,7 +18,7 @@ import (
|
||||||
const (
|
const (
|
||||||
maxConcurrentBlobs = 32
|
maxConcurrentBlobs = 32
|
||||||
maxConcurrency = 10
|
maxConcurrency = 10
|
||||||
maxConcurrencyPreload = 100
|
maxConcurrencyPreload = 20
|
||||||
|
|
||||||
// chunkerBufSize is used in pool.go
|
// chunkerBufSize is used in pool.go
|
||||||
chunkerBufSize = 512 * chunker.KiB
|
chunkerBufSize = 512 * chunker.KiB
|
||||||
|
|
|
@ -193,11 +193,11 @@ func (cmd CmdBackup) Execute(args []string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// fmt.Printf("loading blobs\n")
|
fmt.Printf("loading blobs\n")
|
||||||
// err = arch.Preload()
|
err = arch.Preload()
|
||||||
// if err != nil {
|
if err != nil {
|
||||||
// return err
|
return err
|
||||||
// }
|
}
|
||||||
|
|
||||||
_, id, err := arch.Snapshot(target, parentSnapshotID)
|
_, id, err := arch.Snapshot(target, parentSnapshotID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -110,13 +110,11 @@ func (s Server) LoadJSON(t backend.Type, blob Blob, item interface{}) error {
|
||||||
|
|
||||||
var (
|
var (
|
||||||
zEmptyString = []byte("x\x9C\x03\x00\x00\x00\x00\x01")
|
zEmptyString = []byte("x\x9C\x03\x00\x00\x00\x00\x01")
|
||||||
zEmptyStringReader = bytes.NewReader(zEmptyString)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var zReaderPool = sync.Pool{
|
var zReaderPool = sync.Pool{
|
||||||
New: func() interface{} {
|
New: func() interface{} {
|
||||||
zEmptyStringReader.Seek(0, 0)
|
rd, err := zlib.NewReader(bytes.NewReader(zEmptyString))
|
||||||
rd, err := zlib.NewReader(zEmptyStringReader)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// shouldn't happen
|
// shouldn't happen
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|
Loading…
Reference in New Issue