flat assembler
Message board for the users of flat assembler.

Index > IDE Development > slow replace

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
donkey7



Joined: 31 Jan 2005
Posts: 127
Location: Poland, Malopolska
donkey7 11 May 2006, 18:26
why fasmw is so slow?

i've downloaded file http://ip-to-country.webhosting.info/downloads/ip-to-country.csv.zip and want to delete all quotation marks. using replace (" to nothing) it takes huge amount of time. couldn't it be optimized?

_________________
Keep coding!
Post 11 May 2006, 18:26
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 11 May 2006, 20:10
Perhaps disabling "Undo" would make it faster. It's not much slower than Notepad and some other editors I tried anyway.
Post 11 May 2006, 20:10
View user's profile Send private message Visit poster's website Reply with quote
Urff



Joined: 29 Mar 2006
Posts: 22
Urff 13 May 2006, 11:54
donkey7 optimize the cofiguration of your PC only.... fasmw is faster than Notepad on my pc
Post 13 May 2006, 11:54
View user's profile Send private message Reply with quote
donkey7



Joined: 31 Jan 2005
Posts: 127
Location: Poland, Malopolska
donkey7 13 May 2006, 16:22
notepad isn't written in assembler Smile so don't expect too much.

i noticed that fasmw refreshes statusbar and sliders after each replace. maybe updating only at the end of replace would help?

edit:
and an option to limit the undo stack.
Post 13 May 2006, 16:22
View user's profile Send private message Visit poster's website Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 15 May 2006, 11:03
Enough for my needs - I even use FASMW as Notepad replacement, because of the syntax highlighting - I can see where quotation marks and numbers are Smile
Replacing <1MB files goes in a blink of an eye.
Post 15 May 2006, 11:03
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
donkey7



Joined: 31 Jan 2005
Posts: 127
Location: Poland, Malopolska
donkey7 15 May 2006, 12:02
btw: when reaching about 70% (about four minutes of replacing!) of file (link above) fasmw crashed. i have 512 mb of ram and win98se pl with unofficial service pack http://sp.up.pl/ . i think that undo stack limit is necessary Smile

madis:
i use metapad because it has line wrapping Smile
Post 15 May 2006, 12:02
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 15 May 2006, 14:11
The problem may come from the fact that I don't have Win98, and so I was not testing fasmw on such system.

As for the Notepad replacement - recently I was quit suprised by the fact that one of my friends (who doesn't do any assembly programming at all) started to use FASMW everytime he needs to handle some huge SQL dumps - he told me it's the only editor he tried that allows him to edit 50 MB files without hanging or crashing every few operations.
Post 15 May 2006, 14:11
View user's profile Send private message Visit poster's website Reply with quote
donkey7



Joined: 31 Jan 2005
Posts: 127
Location: Poland, Malopolska
donkey7 15 May 2006, 14:51
1. open huge file
2. replace all 'a' with 'b'
3. replace all 'b' with 'a'
4. repeat steps 2 and 3 million times

fasmw should crash on all winshits Smile

btw: every other editor supports line wrapping. fasmw is like hiew - it can edit largest files without any problem.
Post 15 May 2006, 14:51
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 15 May 2006, 15:07
So perhaps crashing is because of running out of memory?

There a substantial difference between this editor model and hiew, as fasmw has (of course) an "insert mode".
Post 15 May 2006, 15:07
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 15 May 2006, 15:12
running out of memory is no excuse for crash!
Wink
Post 15 May 2006, 15:12
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 15 May 2006, 16:17
Of course, there must be some leak in memory-allocation-error checking, if this is the reason. (Have you noted the EIP of crash?)

Though there still would be a problem if just Windows didn't have enough memory to display the message box with information that it run out of memory Wink Twisted Evil
Post 15 May 2006, 16:17
View user's profile Send private message Visit poster's website Reply with quote
donkey7



Joined: 31 Jan 2005
Posts: 127
Location: Poland, Malopolska
donkey7 15 May 2006, 16:30
Code:
FASMW spowodowaB bBd: nieprawidBowa strona w
module FASMW.EXE przy 017f:0040ff99.
Rejestry:
EAX=ffffffff CS=017f EIP=0040ff99 EFLGS=00010286
EBX=00000000 SS=0187 ESP=0056f9d8 EBP=0056fcc0
ECX=00000001 DS=0187 ESI=00000000 FS=129f
EDX=e0d41ac0 ES=0187 EDI=00000000 GS=0000
Bajtów w CS:EIP:
ab eb 0e b9 40 00 00 00 f3 a5 83 8e 00 ff ff ff 
Stos:
00000001 2fc0ff08 0040e4d2 2fc0fe40 00ca0200 0056fcc0 0056fa04 0000056c 00029880 00000000 2fc0f900 0040fea4 0056faf8 00ca00c0 0056fcc0 0056fa28     


position: 59992,2 or something

i will crash it again and see if the results are the same Very Happy

btw: windows never has enough memory Very Happy

edit:
of course it's newest fasmw.exe

edit2:
other position but same results.


Last edited by donkey7 on 15 May 2006, 16:45; edited 1 time in total
Post 15 May 2006, 16:30
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 15 May 2006, 16:45
I see, this is actually a bug in the routine that handles the "not enough memory" error (it tries to reverse the changes that it was not able to finish, but there's a problem that causes the crash in case when it run out of memory while it trying to store state information for undo).
Post 15 May 2006, 16:45
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 15 May 2006, 16:45
Tomasz Grysztar wrote:
Though there still would be a problem if just Windows didn't have enough memory to display the message box with information that it run out of memory Wink Twisted Evil

but it still shouldn't crash Twisted Evil
btw, it is wise to first free all allocated memory and then display errors Twisted Evil Twisted Evil Twisted Evil

btw, this is quiet nicely solved in FASMLIB
Post 15 May 2006, 16:45
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 15 May 2006, 17:38
vid wrote:
but it still shouldn't crash Twisted Evil

Well this is already not under my jurisdiction.
Post 15 May 2006, 17:38
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 15 May 2006, 18:15
i think it returns in such case... we could try.
Post 15 May 2006, 18:15
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 15 May 2006, 18:29
I think I fixed it in 0.93.5. I also added an option to disable undo buffer, so that you can try making such replaces without wasting a memory for undo. It doesn't appear to gain more speed using this feature, though - the bottleneck lies somewhere else (perhaps in the insertion overhead).
To everyone: please let me know if you find this option useful.


vid: But I did mean that the problem would be if the Windows crashed. Wink
Post 15 May 2006, 18:29
View user's profile Send private message Visit poster's website Reply with quote
okasvi



Joined: 18 Aug 2005
Posts: 382
Location: Finland
okasvi 15 May 2006, 21:14
offtopic: something related to out of memory, I found out that if i try to compile any source, and inside a proc(didnt test otherwise) i have 'locals' without ending 'endl' i always get out of memory error... i had ends instead and was wondering what is the cause for quite some time Mad
Post 15 May 2006, 21:14
View user's profile Send private message MSN Messenger Reply with quote
donkey7



Joined: 31 Jan 2005
Posts: 127
Location: Poland, Malopolska
donkey7 16 May 2006, 11:00
tomasz:
what about noupdate flag (when prompting is disabled)? it will prevent from updating sliders and statusbar after each replace. maybe this will speed things up?

btw: undo should work in slightly another way. when i use it it should undo all relpaces at once - one undo for one operation. so when i replaced all 'a' with 'b' and clicked undo, it should recover entire text.

another tip:
make an option in replace dialog - selection only. it should then search for patterns to replace only in selected text.
Post 16 May 2006, 11:00
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 16 May 2006, 11:19
The "search in selection" was something I always wanted to have here (since I had it in DN's editor on which this one is based), however never found enough time for it, as it's a bit complicated task with this design.
As for undo-ing all replacements at once, there already is a special flag for this implemented, FASMW just forgot to use it. Wink
As for "noupdate" I will try whether it gives any speedup.
Is the "disable undo" of any use, or I should get rid of it?
Post 16 May 2006, 11:19
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.