In my case I've a lot of STL files to open. With latest GLScene, HEAD 0eb11bb1aae7f7110e79064a92ed5b597594921, it will take 2500ms to load all of them.
Changing GLS.VectorFileObjects.pas code from:
procedure TGLBaseMesh.LoadFromFile(const filename: string); var fs: TFileStream; begin FLastLoadedFilename := ''; if fileName <> '' then begin try fs := TFileStream.Create(fileName, fmOpenRead + fmShareDenyWrite); LoadFromStream(fileName, fs); FLastLoadedFilename := filename; finally fs.Free; end; end; end;
to:
procedure TGLBaseMesh.LoadFromFile(const filename: string); var fs: TFileStream; begin FLastLoadedFilename := ''; if fileName <> '' then begin fs := TBufferedFileStream.Create(fileName, fmOpenRead + fmShareDenyWrite); {SID} try LoadFromStream(fileName, fs); FLastLoadedFilename := filename; finally fs.Free; end; end; end;
the loading time decrease to 922ms.
TBufferedFileStream is entered in SysUtils from Delphi 10.1
Hi Shine World, Indeed your BedSTL now loading five times faster. But rotation on my case still no more then 20 FPS. Thanks. Pavel
Log in to post a comment.
In my case I've a lot of STL files to open.
With latest GLScene, HEAD 0eb11bb1aae7f7110e79064a92ed5b597594921,
it will take 2500ms to load all of them.
Changing GLS.VectorFileObjects.pas code from:
to:
the loading time decrease to 922ms.
TBufferedFileStream is entered in SysUtils from Delphi 10.1
Hi Shine World,
Indeed your BedSTL now loading five times faster. But rotation on my case still no more then 20 FPS. Thanks.
Pavel