Recent

Author Topic: ATSynedit Highlighters  (Read 5118 times)

taazz

  • Hero Member
  • *****
  • Posts: 5368
ATSynedit Highlighters
« on: October 13, 2017, 01:40:42 pm »
Does atsynedit has an adapter for the lazarus highlighters? I'm interested in the sql highlighters that lazarus has. At this point I'm interested in the interbase/firebird and sqlite, in the future I'll need all the sql highlighters. Thank you for any info.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

AlexTP

  • Hero Member
  • *****
  • Posts: 2384
    • UVviewsoft
Re: ATSynedit Highlighters
« Reply #1 on: October 13, 2017, 02:40:45 pm »
ATSynEdit don't have adapter for SynEdit (Lazarus) hiliters, it is not small project if you want to make it.

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: ATSynedit Highlighters
« Reply #2 on: October 13, 2017, 03:24:51 pm »
thank you for your time. I'll have to use the lcl synedit for now lets see how much time I get after I finish my active tasklist.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Edson

  • Hero Member
  • *****
  • Posts: 1301
Re: ATSynedit Highlighters
« Reply #3 on: October 13, 2017, 06:31:28 pm »
There is an adapter for SynFacilSyn, what is a scriptable highlighter for SynEdit.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: ATSynedit Highlighters
« Reply #4 on: October 13, 2017, 06:52:20 pm »
There is an adapter for SynFacilSyn, what is a scriptable highlighter for SynEdit.
Downloaded for future reference, for now I'm a bit concerned about the memory requirements of atsynedit, I've seen that it consumes 300MB for 10MB file which forces me to reevaluate using it. Non the less you highlighter will be evaluated, when I get some time. Thank you.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

AlexTP

  • Hero Member
  • *****
  • Posts: 2384
    • UVviewsoft
Re: ATSynedit Highlighters
« Reply #5 on: October 13, 2017, 07:53:34 pm »
300 Mb on 10 Mb file? It dependens on test app - it uses EControl code? Test on demo, which don't use EControl code- demo_simplest.

AlexTP

  • Hero Member
  • *****
  • Posts: 2384
    • UVviewsoft
Re: ATSynedit Highlighters
« Reply #6 on: October 13, 2017, 08:21:53 pm »
Also turn on some compiling options. Mem usage is smaller than in Sublime Text

===
XML log 110Mb file:
Ubuntu 16 x64

Sublime Text 3: mem size 1.3nn Gb
CudaText: mem size 1.1nn Gb
both with Python engine
===

Edson

  • Hero Member
  • *****
  • Posts: 1301
Re: ATSynedit Highlighters
« Reply #7 on: October 13, 2017, 08:23:25 pm »
300 Mb on 10 Mb file? It dependens on test app - it uses EControl code? Test on demo, which don't use EControl code- demo_simplest.

What's EControl and how it affects to the memory comsumption?

What's the normal memory ATSynEdit must use when using a 10Mb file.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

AlexTP

  • Hero Member
  • *****
  • Posts: 2384
    • UVviewsoft
Re: ATSynedit Highlighters
« Reply #8 on: October 14, 2017, 10:32:05 am »
1) EControl is http://wiki.freepascal.org/ATSynEdit_EControl_adapter

2) What memory for 10Mb log- I don't know, because LCL app takes much memory. You can run demo_simplest and see its memory.

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: ATSynedit Highlighters
« Reply #9 on: October 14, 2017, 12:18:27 pm »
Create a new project add the atsynedit in the projects path place a panel with two buttons inside name the first button btnLoad nad second btnReport, copy paste the code below, create your highlighters where the warning is raised replace the file name in the btnLoadclick with an existing 10MB file press the btnload and then the btnreport. I did not made it in to a single procedure to allow atsynedit to call the appropriate highlighter/parser/lexer methods to give the full effect you can try to scroll the contents after the load and before the report to make sure that the highlighting works as expected.
Code: Pascal  [Select][+][-]
  1. unit Unit1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
  9.   StdCtrls, Clipbrd, atsynedit;
  10.  
  11. type
  12.  
  13.   { TForm1 }
  14.  
  15.   TForm1 = class(TForm)
  16.     btnReport: TButton;
  17.     btnLoad: TButton;
  18.     Panel1: TPanel;
  19.     procedure btnLoadClick(Sender: TObject);
  20.     procedure btnReportClick(Sender: TObject);
  21.   private
  22.     { private declarations }
  23.     FEdit : TATSynEdit;
  24.     FOrigin : TFPCHeapStatus;
  25.     FFinal  : TFPCHeapStatus;
  26.   public
  27.     { public declarations }
  28.     constructor Create(aOwner: TComponent); override;
  29.   end;
  30.  
  31. var
  32.   Form1: TForm1;
  33.  
  34. implementation
  35.  
  36. {$R *.lfm}
  37.  
  38. { TForm1 }
  39.  
  40. procedure TForm1.btnLoadClick(Sender: TObject);
  41. begin
  42.   FOrigin := GetFPCHeapStatus;
  43.   FEdit.loadfromFile('10mb.Text.File.log');
  44. end;
  45.  
  46. procedure TForm1.btnReportClick(Sender: TObject);
  47. var
  48.   vMem:String;
  49. begin
  50.   FFinal := GetHeapStatus;
  51.   vMem  := IntToStr(Int64(FFinal.CurrHeapSize - FOrigin.CurrHeapSize));
  52.   ShowMessage('Memory Used : '+IntToStr(vMem)+' Bytes');
  53.   Clipboard.AsText := IntToStr(vMem);
  54. end;
  55.  
  56. constructor TForm1.Create(aOwner: TComponent);
  57. begin
  58.   inherited Create(aOwner);
  59.   FEdit := TATSynEdit.Create(self);
  60.   {$MESSAGE WARN 'Add the highlighter code here too.'}
  61.   FEdit.Parent := self;
  62.   FEdit.Align := alClient;
  63. end;
  64.  
  65. end.
  66.  

This should provide a fairly accurate report of the memory used by the highlighters on each file. You could try to load multiple files with the same highlighter, with different highlighters etc and what changes.
Since the heap before loading the data is substructed at the end only the highlighters specific memory should be reported.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

AlexTP

  • Hero Member
  • *****
  • Posts: 2384
    • UVviewsoft
Re: ATSynedit Highlighters
« Reply #10 on: October 14, 2017, 01:03:50 pm »
Hiliters are using EControl engine, they take much memory for
- parser code
- storage of parsed data
- adapter takes memory

Count memoty w/o EControl usage with SynFacilSyn adapter.

AlexTP

  • Hero Member
  • *****
  • Posts: 2384
    • UVviewsoft
Re: ATSynedit Highlighters
« Reply #11 on: November 19, 2017, 08:43:21 pm »
I see the example above again. It don't use EControl hiliters. So mem usage must be not big. Do you think mem usage is big w/o hiliters?

AlexTP

  • Hero Member
  • *****
  • Posts: 2384
    • UVviewsoft
Re: ATSynedit Highlighters
« Reply #12 on: December 05, 2017, 08:14:12 am »

 

TinyPortal © 2005-2018