Search found 1153 matches

by jj2007
Aug 17, 2017 14:53
Forum: General
Topic: How to reduce the filesize of a compiled file?
Replies: 65
Views: 3843

Re: How to reduce the filesize of a compiled file?

Sure but what if you want to deal with UTF-16, UTF-8, UTF-32, or any other encoding? UTF-16, UTF-8 and "any other encoding" (I assume you mean ordinary codepages - cyrillic and the like) are built into the language, but I admit I have never thought of UTF-32. Can you zip up a UTF-32 text ...
by jj2007
Aug 16, 2017 23:01
Forum: General
Topic: How to reduce the filesize of a compiled file?
Replies: 65
Views: 3843

Re: How to reduce the filesize of a compiled file?

for case insensitive just make text =lcase(text) and look for "style" in the text. 5396 style .0038 seconds here. 5396 Time taken 0.00446 (vs about 0.003 for MasmBasic) You will perhaps notice that 64 bit freebasic is slower at this task than 32 bit, even with -O3 gcc opimizations. 64-bit...
by jj2007
Aug 16, 2017 21:48
Forum: General
Topic: How to reduce the filesize of a compiled file?
Replies: 65
Views: 3843

Re: How to reduce the filesize of a compiled file?

I agree mshtmlc.bi has only newline (chr(10)) I could not get masmbasic.inc. If masmbasic downloaded as a zip I would try it out. But I don't install with .exe installers. I like to see what is going on. Silly I know! Not silly at all: You don't know me. Even Jotti would warn you that some of my ex...
by jj2007
Aug 16, 2017 19:31
Forum: General
Topic: How to reduce the filesize of a compiled file?
Replies: 65
Views: 3843

Re: How to reduce the filesize of a compiled file?

OK ;-) Btw the mshtmlc.bi that I downloaded from https://fossies.org/linux/privat/FreeBASIC-1.05.0-source.tar.gz/FreeBASIC-1.05.0-source/inc/win/mshtmlc.bi?m=b to test your code has no CrLf, just linefeeds; so initially your code didn't work. But Chr(10) did the job, of course (and MasmBasic's Instr...
by jj2007
Aug 16, 2017 17:12
Forum: General
Topic: What is FreeBasic written in?
Replies: 15
Views: 1372

Re: What is FreeBasic written in?

Thanks. So FB is basically a wrapper on top of C... ;-)
by jj2007
Aug 16, 2017 13:44
Forum: General
Topic: How to reduce the filesize of a compiled file?
Replies: 65
Views: 3843

Re: How to reduce the filesize of a compiled file?

Seconds: 0.002644868538482115 Count: 24974 include \masm32\MasmBasic\MasmBasic.inc Init Let esi=FileRead$("mshtmlc.bi") ; 2,488,437 bytes NanoTimer() Inkey Str$("%i line feeds", Count(esi, Lf$)), Str$(" found in %2f seconds", NanoTimer(ms)/1000) EndOfCode 24974 line fe...
by jj2007
Aug 16, 2017 10:59
Forum: General
Topic: What is FreeBasic written in?
Replies: 15
Views: 1372

Re: What is FreeBasic written in?

By default it directly generates assembly code and uses the GNU assembler (GAS) to build an executable. In the 6880 lines disassembly of a small FB exe, over 100 calls to msvcrt routines are present. If I eliminate the -p C:\TDM-GCC-32\bin from the commandline, I get even more calls to the CRT. Are...
by jj2007
Aug 16, 2017 10:03
Forum: General
Topic: How to reduce the filesize of a compiled file?
Replies: 65
Views: 3843

Re: How to reduce the filesize of a compiled file?

A simple Tally of characters in a string. That is simpler than what the other example does, but it's quite OK because the bottleneck here is Instr() , which is what's working also inside Count (source, part): include \masm32\MasmBasic\ MasmBasic.inc ; download Init totalsize=50000000 mov ecx, total...
by jj2007
Aug 16, 2017 7:49
Forum: General
Topic: How to reduce the filesize of a compiled file?
Replies: 65
Views: 3843

Re: How to reduce the filesize of a compiled file?

The problem was unlike the old DOS machines the assembler code simply became calls to the window's api and really there was no longer any speed advantage in using it. All that cool direct to the metal stuff was no longer possible. Of course it is possible! There are areas, I/O for example, where yo...
by jj2007
Aug 16, 2017 7:13
Forum: General
Topic: How to reduce the filesize of a compiled file?
Replies: 65
Views: 3843

Re: How to reduce the filesize of a compiled file?

You do realize this is an I/O bound problem, not CPU, right? 14 ms to read the file into an array Now checking 250281 lines for 'esp': 24 ms to count 'esp' Reading the file into a string array, yes, partly. Counting the lines that contain "esp", definitely not. Furthermore this is a great...
by jj2007
Aug 15, 2017 22:17
Forum: General
Topic: How to reduce the filesize of a compiled file?
Replies: 65
Views: 3843

Re: How to reduce the filesize of a compiled file?

the manual higher level optimizations (algorithms, ...) are far more important than manual lower level optimizations, as the latter can be done by compilers. So if you (find and) use some O(n*log(n)) algorithm instead of some O(n²) one that would be far better than any optimizations in assembly lan...
by jj2007
Aug 15, 2017 20:56
Forum: General
Topic: How to reduce the filesize of a compiled file?
Replies: 65
Views: 3843

Re: How to reduce the filesize of a compiled file?

Truth is that dense assembler code beats C any time (there is a small code cache, for example). Beats it at what metric? A well-written C routine can easily best a naive assembler implementation, however dense. A well-written assembler routine would be approximately equal to a well-written C routin...
by jj2007
Aug 15, 2017 20:12
Forum: General
Topic: How to reduce the filesize of a compiled file?
Replies: 65
Views: 3843

Re: How to reduce the filesize of a compiled file?

I love benchmarking! Can you produce an example where Java is faster than C, or, even worse, assembly? e.g. see http://blog.cfelde.com/2010/06/c-vs-java-performance/ or https://www.ibm.com/developerworks/java/library/j-jtp09275/index.html for some examples. Good read, thanks. Repeating those benchm...
by jj2007
Aug 15, 2017 18:21
Forum: General
Topic: How to reduce the filesize of a compiled file?
Replies: 65
Views: 3843

Re: How to reduce the filesize of a compiled file?

While that may be true at a very small scale it often is not at a larger scale. For example even dynamically compiled languages like C# or Java are faster than C sometimes due to optimizations at runtime (like partial evaluation), which is not really possible in C or, even worse, assembly. I love b...
by jj2007
Aug 15, 2017 13:00
Forum: General
Topic: How to reduce the filesize of a compiled file?
Replies: 65
Views: 3843

Re: How to reduce the filesize of a compiled file?

IMHO everything < 1MB is fine nowadays and no bloat for a simple "Hello world" program. Anyway, FreeBasic should be a programming language that is easy to use and fast. You probably won't get that when optimizing for executable size. That is hearsay. Truth is that dense assembler code bea...

Go to advanced search