Search found 401 matches

by vvhitevvizard
18 Dec 2018, 15:32
Forum: Ask For Help
Topic: AHK v2: converting/optimizing scripts Topic is solved
Replies: 266
Views: 31809

Re: AHK v2: converting/optimizing scripts Topic is solved

could u pls test it out (I added compiled .bin for convinience) https://www.autohotkey.com/boards/viewtopic.php?p=253748#p253748 and in the next post, maybe u know, why can't we just initialize buffer with VarSetCapacity , load raw data into it, and use it as a function with &buffer the only way it ...
by vvhitevvizard
18 Dec 2018, 15:15
Forum: Ask For Help
Topic: AHK v2: converting/optimizing scripts Topic is solved
Replies: 266
Views: 31809

Re: AHK v2: converting/optimizing scripts Topic is solved

Compression API takes care of most of that. with such logic we have overbloated stuff all over the place. We start using mcoding to optimize at first place And there is also potential of being able to load them directly ourselves without ever writing to disk... once someone figures out how to do it...
by vvhitevvizard
18 Dec 2018, 15:13
Forum: Ask For Help
Topic: AHK v2: converting/optimizing scripts Topic is solved
Replies: 266
Views: 31809

Re: AHK v2: converting/optimizing scripts Topic is solved

oif2003 wrote:
18 Dec 2018, 15:11
DLL != satellite file. We can embed them just like MCode if push comes to shove.
Empty DLL is about 3k redundant data. I managed to create 1k empty DLL but its rather a hack with zeroed sections that overlap each other.
by vvhitevvizard
18 Dec 2018, 15:10
Forum: Ask For Help
Topic: AHK v2: converting/optimizing scripts Topic is solved
Replies: 266
Views: 31809

Re: AHK v2: converting/optimizing scripts Topic is solved

We can always use separate DLLs or compile specific version for each task. Given the amount of memory and storage most systems that run AHK v2 have, the savings may not be worth the effort. I meant that for json.Get it will be a fixed-function logic mcoded. Unusable for other tasks. there is no poi...
by vvhitevvizard
18 Dec 2018, 14:57
Forum: Ask For Help
Topic: AHK v2: converting/optimizing scripts Topic is solved
Replies: 266
Views: 31809

Re: AHK v2: converting/optimizing scripts Topic is solved

If you can reliably load a DLL manually, the advantage of MCode may become marginal I was about to proceed with json.Get optimizations using fixed (hardcoded) mcode chunks. and u say "marginal". whats the point of DLL storing mcode chunks that have no use for other applications except the function ...
by vvhitevvizard
18 Dec 2018, 14:35
Forum: Ask For Help
Topic: AHK v2: converting/optimizing scripts Topic is solved
Replies: 266
Views: 31809

Re: AHK v2: converting/optimizing scripts Topic is solved

Would it be easier to figure out how to manually load a DLL? good link. but again. issue here is badly designed mcode. Would it be easier to make portable mcode at first place :) for c: local vars, DLL function pointers passed with args from AHK, no static and global vars (storing mcode's non-volat...
by vvhitevvizard
18 Dec 2018, 14:25
Forum: Ask For Help
Topic: AHK v2: converting/optimizing scripts Topic is solved
Replies: 266
Views: 31809

Re: AHK v2: converting/optimizing scripts Topic is solved

But I dont understand why this (w/o allocating new memory chunk and copying data into it) doesnt work:

Code: Select all

VarSetCapacity(b,f.length)
n:=f.RawRead(b, f.length)
DllCall("VirtualProtect", "ptr",&b, "uint",n, "uint",0x40, "uintp",op)
msgbox(DllCall(&b))
by vvhitevvizard
18 Dec 2018, 14:13
Forum: Ask For Help
Topic: AHK v2: converting/optimizing scripts Topic is solved
Replies: 266
Views: 31809

Re: AHK v2: converting/optimizing scripts Topic is solved

there is a lot of logic regarding relocations inside my framework. If we connect both things they can work together. thats the issue. 1000 lines of code for COFF format. And we would have to add even more by including ELF support. Its a bit complicated for my case cuz I do know if I start mcoding s...
by vvhitevvizard
17 Dec 2018, 20:01
Forum: Ask For Help
Topic: AHK v2: converting/optimizing scripts Topic is solved
Replies: 266
Views: 31809

Re: AHK v2: converting/optimizing scripts Topic is solved

It seems like you are already on the path of finding a general solution to the problem! I noticed 1 more strange thing as well: within MCode initializer function we call VirtualProtect and declare the size of memory required to cram our mcode into it, we give that memory area PAGE_EXECUTE_READWRITE...
by vvhitevvizard
17 Dec 2018, 12:37
Forum: Ask For Help
Topic: AHK v2: converting/optimizing scripts Topic is solved
Replies: 266
Views: 31809

Re: AHK v2: converting/optimizing scripts Topic is solved

If you could combine this with the existing framework of: https://github.com/nnnik/MCode-Ex That would be of great benefit to me :) wow nice framework! Alas, I don't have installed VC at the moment. :( We have 2 different object formats here - Linux ELF (used by GCC, Fasm, TCC) and MS COFF .obj (us...
by vvhitevvizard
17 Dec 2018, 10:26
Forum: Ask For Help
Topic: AHK v2: converting/optimizing scripts Topic is solved
Replies: 266
Views: 31809

Re: AHK v2: converting/optimizing scripts Topic is solved

You can test to see that static variables do not work correctly under MCode. I figured out the issue. As u can see in the function u used (I modified it and added comments), in order to initialize MCode from the ELF object file, it loads ONLY first section, .text : f:=o_load("wstrings.o") ... o_loa...
by vvhitevvizard
17 Dec 2018, 05:03
Forum: Ask For Help
Topic: AHK v2: converting/optimizing scripts Topic is solved
Replies: 266
Views: 31809

Re: AHK v2: converting/optimizing scripts Topic is solved

- Can someone give me a summary of what people are trying to achieve in this thread? Thanks. General optimizations for performance and code size (small but effective functions-inliners) for AHK v2. And AHK v1.1 -> v2 conversion issues. And solving some other issues in the bargain. Last challenge wa...
by vvhitevvizard
17 Dec 2018, 04:50
Forum: Ask For Help
Topic: AHK v2: converting/optimizing scripts Topic is solved
Replies: 266
Views: 31809

Re: AHK v2: converting/optimizing scripts Topic is solved

BTW, like TCC, but for Assembly: Fasm into a simple DLL which allows to assemble just inside the memory . The package contains short documentation, demonstration program: https://board.flatassembler.net/topic.php?p=48376#48376 Also, FASM can create not only DLL but ELF object files as well. FASM cod...
by vvhitevvizard
16 Dec 2018, 06:10
Forum: Ask For Help
Topic: AHK v2: converting/optimizing scripts Topic is solved
Replies: 266
Views: 31809

Re: AHK v2: converting/optimizing scripts Topic is solved

v1.3.1 ok. I 1-lined it eventually :) a tad long line tho. 422 vs 438 of v1.3: +3.7% for ".0093378080" string. So now its close to Format("{:.4g}" , but with 2 additional features. Deleted it. This variant (unlike 1.2.1) fails on integers. here's your smartR with some tweaks ur variant moves even f...
by vvhitevvizard
16 Dec 2018, 05:56
Forum: Ask For Help
Topic: AHK v2: converting/optimizing scripts Topic is solved
Replies: 266
Views: 31809

Re: AHK v2: converting/optimizing scripts Topic is solved

v1.3 438 vs 500 of v2.1.1: +13.5% for ".0093378080" string SmartR(_a){ ;v1.3 round down to p significant digits (precision), limit decimals to m ;"-000.93379" > -0.934, ".0093379" > 0.00934, "724.764" > 724.8, "5550.764" > 5551 static p:=4, d:=8 r:=((i:=InStr(a:=LTrim(_a, "-0"),".",1))=1) ? (a ~= "...
by vvhitevvizard
16 Dec 2018, 03:46
Forum: Ask For Help
Topic: AHK v2: converting/optimizing scripts Topic is solved
Replies: 266
Views: 31809

Re: AHK v2: converting/optimizing scripts Topic is solved

Yeah Imagine a few hundred thousand DllCalls passing along some OpenGL data. The overhead of each DllCall would be greater by a few magnitudes if you used AHK to do them. OpenGL is a bit different story - GPU works in parallel with CPU. Ok ok. Maybe GDI work wasn't a glaring example. Ok, other exam...
by vvhitevvizard
16 Dec 2018, 02:09
Forum: Ask For Help
Topic: AHK v2: converting/optimizing scripts Topic is solved
Replies: 266
Views: 31809

Re: AHK v2: converting/optimizing scripts Topic is solved

what about this? it fails on this string: ".0000093378080" with p:=2 , d:=8 : -> 0.00000934 . expected is 0.0000093 cuz p=2 ;) U might want to check decimals limit right before calling Format that part in ur code looks so so. 2 Format calls. Trying to replace the exponent output - and this will hap...
by vvhitevvizard
16 Dec 2018, 01:37
Forum: Ask For Help
Topic: AHK v2: converting/optimizing scripts Topic is solved
Replies: 266
Views: 31809

Re: AHK v2: converting/optimizing scripts Topic is solved

It does! =) First I checked "-55500.76400989" > "-55501" : works as expected It doesn't respect max decimals (2nd condition) tho. :D score is (urs/mine/vanilla format): 454 vs 546 vs 391 for ".0093378080" string 17% improvement Try the following: "000.93378080" should be "0.9" for p=2 , d=1 . decima...
by vvhitevvizard
16 Dec 2018, 00:39
Forum: Ask For Help
Topic: AHK v2: converting/optimizing scripts Topic is solved
Replies: 266
Views: 31809

Re: AHK v2: converting/optimizing scripts Topic is solved

meanwhile back to Floats pretty-printing. U bumped me up against revision of Format("{:g}" potential and unlike other float formatting modes for the function (e, f, a), this one is what I needed: Round to N significant digits. It turned out it was .4g logic of Format function that I recreated in par...
by vvhitevvizard
15 Dec 2018, 22:26
Forum: Ask For Help
Topic: AHK v2: converting/optimizing scripts Topic is solved
Replies: 266
Views: 31809

Re: AHK v2: converting/optimizing scripts Topic is solved

Nice. So TCC updates DLL functions addresses for code snippets at compile time. (for included DLLs) BTW, having started parsing AHK functions' source code, we eventually could end up with full C working projects. But thats not the point I guess - I do like interpreted scripting with mixed in compile...

Go to advanced search