-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Description
When I tried to insert thousands of images into a xlsx file, It was very slow...
It took hundreds milliseconds per item.
Steps to reproduce the issue:
package main
import (
"fmt"
_ "image/jpeg"
"log"
"github.com/360EntSecGroup-Skylar/excelize"
)
func main() {
xlsx := excelize.NewFile()
for i := 0; i < 10000; i++ {
if err := xlsx.AddPicture("Sheet1", fmt.Sprintf("A%d", i+1), "./lena.jpg", ""); err != nil {
log.Fatalln(err)
}
if i%100 == 0 {
log.Printf("%d done", i)
}
}
if err := xlsx.SaveAs("./Book1.xlsx"); err != nil {
log.Fatalln(err)
}
}Describe the results you received:
...
2018/09/28 22:54:20 4000 done
2018/09/28 22:54:48 4100 done
2018/09/28 22:55:16 4200 done
2018/09/28 22:55:45 4300 done
2018/09/28 22:56:22 4400 done
2018/09/28 22:56:59 4500 done
2018/09/28 22:57:30 4600 done
2018/09/28 22:58:04 4700 done
2018/09/28 22:58:45 4800 done
2018/09/28 22:59:22 4900 done
2018/09/28 22:59:58 5000 done
Describe the results you expected:
Well, better performance?
Output of go version:
go version go1.9.4 darwin/amd64
Excelize version or commit ID:
[[projects]]
name = "github.com/360EntSecGroup-Skylar/excelize"
packages = ["."]
revision = "eb62256d165607c6877ce88efbba10c119137b3d"
version = "v1.3.0"
Environment details (OS, Microsoft Excel™ version, physical, etc.):
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/lianzhao/work"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/3x/fvc3fcrs5139r6g4k36sxl_40000gn/T/go-build268279933=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request