惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

H
Help Net Security
T
ThreatConnect
SecWiki News
SecWiki News
F
Future of Privacy Forum
AWS News Blog
AWS News Blog
C
Cisco Blogs
A
Arctic Wolf
Vercel News
Vercel News
The GitHub Blog
The GitHub Blog
Scott Helme
Scott Helme
V
V2EX
博客园 - 叶小钗
阮一峰的网络日志
阮一峰的网络日志
K
Kaspersky official blog
G
Google Developers Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
P
Privacy International News Feed
C
Cyber Attacks, Cyber Crime and Cyber Security
N
News | PayPal Newsroom
Schneier on Security
Schneier on Security
NISL@THU
NISL@THU
Microsoft Azure Blog
Microsoft Azure Blog
量子位
The Hacker News
The Hacker News
Stack Overflow Blog
Stack Overflow Blog
Security Latest
Security Latest
M
Microsoft Research Blog - Microsoft Research
Google Online Security Blog
Google Online Security Blog
博客园_首页
C
CXSECURITY Database RSS Feed - CXSecurity.com
I
InfoQ
Google DeepMind News
Google DeepMind News
Y
Y Combinator Blog
The Cloudflare Blog
Microsoft Security Blog
Microsoft Security Blog
Martin Fowler
Martin Fowler
Cisco Talos Blog
Cisco Talos Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Troy Hunt's Blog
F
Fox-IT International blog
S
Security @ Cisco Blogs
博客园 - 司徒正美
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
C
Comments on: Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
L
LINUX DO - 最新话题
GbyAI
GbyAI
Project Zero
Project Zero
腾讯CDC
T
Tailwind CSS Blog

博客园 - 秋·风

linux/windows双系统可用的打包程序 使用FPC自带的纯 Pascal 实现的 Zlib 替代品——paszlib QFLazarus使用说明 忽略lazarus console in/output窗显示的转义码 编译fpc遇到的怪事 取消树莓派的系统双击桌面图标时出现弹窗的选择提示 银河麒麟v11安装lazarus的方法 【小技巧】lazarus的应用设置某个form不在任务栏显示(linux) 用lazarus封装了linux的rsync SimpleXML-for-lazarus fastreport在windows11(lazarus)报表设计时出现的问题 用lazarus编写的deb打包工具 龙芯deepin 25系统使用旧世界软件的方法 SimpleJSON for lazarus 中文转全拼音和首字母 - 秋·风 lazarus扩展IDE宏的方法 调整lazarus gtk2编辑控件背景颜色 fpc/lazarus可用的宏 Lazarus IDE宏列表 【原创控件】PopupMenu和MainMenu自绘单元 【原创控件】PopupMenu自绘 【原创控件】lazarus自定义mainmenu菜单栏(2026-02-26 增加菜单项图标尺寸参数) cudaText存在段落长度超过一定字数时会出现字符重叠的问题 lazarus编写的程序在Ubuntu任务栏/快捷栏不显示设定的图标 lazarus实现拖放文件 在uos使用lazarus调试时遇到的问题 【原创控件】lazarus IDE界面备份和恢复插件(2026-02-07增加恢复默认布局及官方已集成到lazarus) lazarus for arm32编译so链接出错
fastreport报表编辑器在aarch64等非x86_64 CPU第一次打开慢的解决方案
秋·风 · 2026-05-26 · via 博客园 - 秋·风

fastreport报表编辑器在aarch64等非x86_64 CPU第一次打开慢的解决方案,这个方案是由“安全生产监管QQ 327846439”提供的,非常感谢“安全生产监管”的无私分享!
在aarch64慢主要是解压gzip资源非常耗时,他将设计器用到的500多个资源图片,从fr的资源提前处理并解压出来,经处理后,第一次打开报表编辑器从10多秒提升到2秒左右。
1、打开Sources/FastReport/FPC/Sources/frxRes.pas

  TfrxImageResources = class(TfrImageResources)
  private
    FDisabledButtonImages: TImageList;
    FMainButtonImages: TImageList;
    FPreviewButtonImages: TImageList;
    FObjectImages: TImageList;
    FWizardImages: TImageList;
    function GetDisabledButtonImages: TImageList;
    function GetMainButtonImages: TImageList;
    function GetPreviewButtonImages: TImageList;
    function GetObjectImages: TImageList;
    function GetWizardImages: TImageList;
  protected
    procedure ClearFields; override;
  public
    procedure SetButtonImages(Images: TBitmap; Clear: Boolean = False);
    procedure SetObjectImages(Images: TBitmap; Clear: Boolean = False);
    procedure SetPreviewButtonImages(Images: TBitmap; Clear: Boolean = False);
    procedure SetSpeedButtonGlyph(AButton: TSpeedButton; AIndex: Integer);  //delete fix for Transperent when WinLaz fix it.
    procedure SetWizardImages(Images: TBitmap; Clear: Boolean = False);
    procedure PreloadImages; virtual;//<---添加这行

    property DisabledButtonImages: TImageList read GetDisabledButtonImages;
    property MainButtonImages: TImageList read GetMainButtonImages;
    property PreviewButtonImages: TImageList read GetPreviewButtonImages;
    property ObjectImages: TImageList read GetObjectImages;
    property WizardImages: TImageList read GetWizardImages;
    property ImagesPPI;
  end;

在适当位置添加以下代码:

procedure TfrxImageResources.PreloadImages;
{$IFDEF Linux}
var
 BaseDir: string;
 Ok: Boolean;
{$ENDIF}
begin
  {$IFDEF Linux}
  BaseDir := ExtractFilePath(ParamStr(0)) + 'frx_images' + PathDelim;
  if DirectoryExists(BaseDir) then
  begin
    Ok := LoadImageListFromPngFiles(BaseDir + 'MainButtonImages' + PathDelim, FMainButtonImages, 16, 16);
    if Ok then
    begin
      Ok := LoadImageListFromPngFiles(BaseDir + 'ObjectImages' + PathDelim, FObjectImages, 16, 16);
      if Ok then
      begin
        Ok := LoadImageListFromPngFiles(BaseDir + 'PreviewButtonImages' + PathDelim, FPreviewButtonImages, 16, 16);
        if Ok then
        begin
          Ok := LoadImageListFromPngFiles(BaseDir + 'DisabledButtonImages' + PathDelim, FDisabledButtonImages, 16, 16);
          if Ok then
          begin
            Ok := LoadImageListFromPngFiles(BaseDir + 'WizardImages' + PathDelim, FWizardImages, 32, 32);
          end;
        end;
      end;
    end;
  end;
{$endif}
  FDisabledButtonImages := GetDisabledButtonImages;
  FMainButtonImages := GetMainButtonImages;
  FPreviewButtonImages := GetPreviewButtonImages;
  FObjectImages := GetObjectImages;
  FWizardImages := GetWizardImages;
end;

2、打开/Sources/FastReport/FPC/Sources/frxClass.pas
在initialization后面添加红色代码:

initialization

{$IFDEF Linux}
  if DirectoryExists(ExtractFilePath(ParamStr(0)) + 'frx_images') then
    frxImages.PreloadImages;
{$endif}

{$IFDEF DELPHI16}
  StartClassGroup(TControl);

3、下载frx_images.zip(http://sgamer.oicp.net:8888/%E5%85%B6%E5%AE%83%E4%B8%8B%E8%BD%BD%E6%96%87%E4%BB%B6/frx_images.zip
1)将这个压缩包解压到用到fr的主程序相同的目录

image

 2)将这个目标拷贝到lazarus这个目录

image

 4、重新编译fr控件及重构lazarus,打开报表编辑器从之前要10多秒,现在只需2秒左右,速度提升十分明显。
注意:
如果没frx_images目录,第一次打开报表编辑器时速度和原来没修改是一样的。