Search found 87 matches
- Thu Nov 07, 2019 7:55 am
- Forum: Feature
- Topic: Strings concatenation optimisation
- Replies: 14
- Views: 25876
Re: Strings concatenation optimisation
The BB compiler optimized the first aspect, i.e. it tries to avoid an extra buffer when it is save to do so. So far, I don't know where this check is done in the compiler. View DevCPB.CheckBuffering and Overlap; I have pointed out some improvements, which is not difficult to implement(I have comple...
- Tue Nov 05, 2019 2:48 am
- Forum: Feature
- Topic: Strings concatenation optimisation
- Replies: 14
- Views: 25876
Re: Strings concatenation optimisation
Note that copying the string is not even in itself, but in some buffer? CODE: SELECT ALL mov edi, 1677721600 \ mov esi, 1677721606 / not the same address oo, You are bothered by the decoder! It decodes the static file instead of loading the code stream of the module; the loaded one is: StdCoder.Dec...
- Mon Nov 04, 2019 10:54 am
- Forum: Feature
- Topic: Strings concatenation optimisation
- Replies: 14
- Views: 25876
Re: Strings concatenation optimisation
no! the current compiler has already done this optimization, check my previous post (form 1); or you can check it by decoder(e.g. open code file)Zorko wrote: As far as I understand, now BlackBox always uses the buffer.
- Thu Oct 31, 2019 6:35 am
- Forum: Feature
- Topic: Strings concatenation optimisation
- Replies: 14
- Views: 25876
Re: Strings concatenation optimisation
Rethink Oleg's question, the strings operation need some improvement; 1, the form: a:=a+'str'; (no buffer needed) old : a :=a; a += 'str'; new: a := (scan 0X); a+="str"; improve point: read a instead copy a; 2,the form: a := b + a; (need buffer) old: a' =b; a'+= a; a:=a'; new: a':=a; a:=b;...
- Sat Oct 26, 2019 6:21 pm
- Forum: Feature
- Topic: Strings concatenation optimisation
- Replies: 14
- Views: 25876
Re: Strings concatenation optimisation
the output code is correct, Oleg complain the qulity of the output code: the a :=a +'str'; output a :=a; a+="str"; instead of a.append('str'); copy(write) itself is not necessary and inefficient, get(read) it's length is better; but I think the code generater is good enough,look the main c...
- Fri Aug 16, 2019 10:16 am
- Forum: Component Pascal
- Topic: about CASE string OF
- Replies: 8
- Views: 19544
Re: about CASE string OF
the improved one has finished, almost same size and speed as handwritten code,Welcome to test and feedback.
- Mon Aug 12, 2019 4:48 pm
- Forum: Component Pascal
- Topic: about CASE string OF
- Replies: 8
- Views: 19544
Re: about CASE string OF
Wirth uses a different technique altogether to search for keywords in his latest Oberon compiler. He uses the length of the string to limit the number of items that need to be searched. thanks, I will try . but first I need to understand the condition alogrithm and pseudo output of the "useTre...
- Mon Aug 12, 2019 7:00 am
- Forum: Component Pascal
- Topic: about CASE string OF
- Replies: 8
- Views: 19544
Re: about CASE string OF
Does this syntax generates faster code? no, as same as the if..elsif..end; I have writed an improved one,output like: PROCEDURE Keyword(VAR name: ARRAY OF CHAR; VAR sym,c: BYTE); BEGIN sym:=ident; CASE name[0] OF | "A": IF name = "ARRAY" THEN sym := array END | "B": IF...
- Mon Aug 12, 2019 3:37 am
- Forum: Component Pascal
- Topic: about CASE string OF
- Replies: 8
- Views: 19544
Re: about CASE string OF
I mean a bit mess , sometimes CASE is more readable and writable than IF... ESLIF .... e.g. IF (str$ = "PROCEDURE") THEN a := scanner.syntax.KeyWord; state := regular; (* интерпретировать звездочку как маркер экспорта *) stateExport := exportCare; ELSIF (str$ = "VAR") OR (str$ = ...
- Sun Aug 11, 2019 3:57 pm
- Forum: Component Pascal
- Topic: about CASE string OF
- Replies: 8
- Views: 19544
about CASE string OF
Is anyone interested in CASE string OF ? e.g. MODULE ObxTest; IMPORT Log := StdLog; PROCEDURE Do* (); VAR str: ARRAY 12 OF CHAR; BEGIN str := "hello5"; CASE str OF | "hello", "hello2", 'book': Log.String('world'); Log.Ln; | "world": Log.String('hello'); Log.Ln...