Reply
Old Jun 12, 2008, 02:42pm Default Re: Today !
APK
APK's Avatar
Elite Member

Posts: 368
Name: The Duke of URL
Karma: APK will become famous soon enough
Quote:
Originally Posted by sepulchre View Post
Thanks guys! I'm stuffing myself with my favorite: spice cake!
HA! Enjoy it... it's "good stuff", I agree & approve, 110%!



Me? It's "Disassembly/Trace" time man, because @ this point, based on our discussion above (DO see my reply by the by)?

Well, I * THINK * I can't do anymore for Delphi code optimization (& the Realtime CPU priority assignment I do @ form creation time can't REALLY be improved upon either (I am NOT going to attempt to disassemble OR rewrite Win32 API libs code either - THIS I have to 'watch it on' though... not good for single CPU rigs, thank goodness they are no longer "the norm")).

I need the trace/debug assembly code...

Why the Asm dump in disassembly??

Well - to help ME, do some "Inline Assembler" code, via the ASM directive Delphi has (C/C++ also do), for extra speed boosting...

APK

P.S.=> This is a "BUMMER" to do though, & takes me tons of time to get "absolutely right" too... lol, time to put on (editing) "THE THEME FROM MISSION IMPOSSIBLE" by U², because it may very well BE that (I have a hard time with doing this is why I state that)... apk
__________________
"I'm Reese: Sgt. TechComVN38416, assigned to protect you - You've been TARGETTED FOR TERMINATION!"

Last edited by APK; Jun 12, 2008 at 03:05pm.
APK is offline
Reply With Quote
View Public Profile Visit APK's homepage! Send a private message to APK
 
Old Jun 12, 2008, 02:42pm Default Re: Today !
ianm's Avatar
Just Cuddly Old Me™

Posts: 1,502
Karma: ianm is on a distinguished road
Hey, Happy Birthday Ken, the birthdays are ringing today around the forums

Vista Business, yeah, i like it, Vista in general that is, Home Basic on the machine as a main OS and Business inside VPC. Using it for my college study.
__________________
blog | flickr | fazyluckers | graphic design forum | graphic design links | The Photo Forum


MCP | MCDST | MCTS
ianm is offline
Reply With Quote
View Public Profile Visit ianm's homepage! Send a private message to ianm
 
Old Jun 12, 2008, 03:21pm Default Re: Today !
sepulchre's Avatar
Elite Member

Posts: 489
Name: Ken
Karma: sepulchre will become famous soon enough
Thanks, Ian.

Btw, do you troubleshoot Users of XP?

@apk: sorry man, but I'm on no shape to contemplate code today! (too much, erm . . . cake!)
__________________
(\__/)
(='.'=)
(")_(")

Last edited by sepulchre; Jun 12, 2008 at 03:24pm.
sepulchre is offline
Reply With Quote
View Public Profile Send a private message to sepulchre
 
Old Jun 12, 2008, 03:57pm Default Re: Today !
ianm's Avatar
Just Cuddly Old Me™

Posts: 1,502
Karma: ianm is on a distinguished road
Well, I have the qualification and the knowledge, but still loking for the job to build up experience - so er....yes
__________________
blog | flickr | fazyluckers | graphic design forum | graphic design links | The Photo Forum


MCP | MCDST | MCTS
ianm is offline
Reply With Quote
View Public Profile Visit ianm's homepage! Send a private message to ianm
 
Old Jun 12, 2008, 04:01pm Default Re: Today !
sepulchre's Avatar
Elite Member

Posts: 489
Name: Ken
Karma: sepulchre will become famous soon enough
Quote:
Originally Posted by ianm View Post
Well, I have the qualification and the knowledge, but still loking for the job to build up experience - so er....yes
To troubleshoot the USERS? Wow! Cool!
__________________
(\__/)
(='.'=)
(")_(")
sepulchre is offline
Reply With Quote
View Public Profile Send a private message to sepulchre
 
Old Jun 12, 2008, 04:15pm Default Re: Today !
ianm's Avatar
Just Cuddly Old Me™

Posts: 1,502
Karma: ianm is on a distinguished road
that's what those qualifications say down there in my sig anyways
__________________
blog | flickr | fazyluckers | graphic design forum | graphic design links | The Photo Forum


MCP | MCDST | MCTS
ianm is offline
Reply With Quote
View Public Profile Visit ianm's homepage! Send a private message to ianm
 
Old Jun 12, 2008, 04:25pm Default Re: Today !
sepulchre's Avatar
Elite Member

Posts: 489
Name: Ken
Karma: sepulchre will become famous soon enough
Well, it says 'Troubleshooting XP' and 'Supporting Users' . . but do you troubleshoot Users as well?

Sorry, just having a little too much fun today.
__________________
(\__/)
(='.'=)
(")_(")
sepulchre is offline
Reply With Quote
View Public Profile Send a private message to sepulchre
 
Old Jun 12, 2008, 07:57pm Default Re: Today !
APK
APK's Avatar
Elite Member

Posts: 368
Name: The Duke of URL
Karma: APK will become famous soon enough
Sepulchre...

Get ready to laugh...

I just thought of a CHEAP WAY to more speed: Console Mode (DOS commandline/tty type app) instead, of a GUI one.

(This is no "major project" that will have 1,000's of users, lol, doesn't have to be "dead solid perfect" either, just fast, for MY needs... (so, that said? I'll do a 'crude console' program - bet it nearly doubles in speed, just on not doing screen device context (Delphi TCanvas object) alone))



The update to the Label's captions for starttime/endtime, plus the status bar? COSTS... I'll be doing away w/ that CPU killer alone, plus the GUI overheads.

APK

P.S.=> Between THAT, & maybe if I get lucky a tracedebug ASM dump code set I can use for Inline ASM directive usage, especially for its loop engine/active ingredient portion? Yea... it'll work - I bet I can get it down from 2 minutes over 533,000++ entries, down to 1.3 minutes runtime on the same amount! apk
__________________
"I'm Reese: Sgt. TechComVN38416, assigned to protect you - You've been TARGETTED FOR TERMINATION!"

Last edited by APK; Jun 12, 2008 at 08:00pm.
APK is offline
Reply With Quote
View Public Profile Visit APK's homepage! Send a private message to APK
 
Old Jun 13, 2008, 02:01am Default Re: Today ? Down from near 2 minutes, to ONLY 10 seconds!
APK
APK's Avatar
Elite Member

Posts: 368
Name: The Duke of URL
Karma: APK will become famous soon enough
Sepulchre, I was correct...

By going console mode - I literally got a HUGE performance boost & gigantic orders of magnitude speed increase!

(W/ some variances - Especially if I cutoff tty console outputs (radical & ugly, & no indicator of progress thru the array of entries from the file... but speed was what I was after, after all, & I got that, bigtime, thru that same cutting down of 1,498,232 lines of non-normalized text data into a 533,000++ lines of text data in my custom HOSTS file))

Down from near 2 minute mark to ONLY 10 seconds, via this code:

================================================== ==

{COPYRIGHT APK - Alexander Peter Kowalski 06/01/2008 onwards}

program APKHostsFileRewriterConsoleModeApp;
//Have this down to 11 second runtimes in consolemode/DOS tty mode
//(w/ no screen outputs that is (It is slower with them @ around 30 seconds))... apk
//MUCH FASTER THAN GUI MODE MODEL WHICH TAKES JUST UNDER 2 MINUTES... apk

{$define nodebug}
{$STACKCHECKS OFF}
{$D-} //will prevent placing Debug info to your code.
{$L-} //will prevent placing local symbols to your code.
{$O+} //will optimize your code, remove unnecessary variables etc.
{$Q-} //removes code for Integer overflow-checking.
{$R-} //removes code for range checking of strings, arrays etc.
{$S-} //removes code for stack-checking. USE ONLY AFTER HEAVY TESTING !
{$Y-} //will prevent placing smybol information to your code
{$H-} //Forces ShortString usage (no heap usage) until password routine... apk

{$APPTYPE CONSOLE}

uses
SysUtils, StrUtils, Windows;
//I eliminated the "uses" dependency on the Forms class object units by NOT using Application.Handle
//& instead stepping right down to the clean Win32 API code again for ProcessID + ProcessHandle
//To be able to set this application's parent thread to REALTIME CPU Usage & also its child
//thread (1 of 2) active to realtime when/if needed too... apk

{$H-}

var
Ch: ShortString;
F1:TextFile;
F2:TextFile;
Flags:TReplaceFlags;
Counter:Integer;
ThreadHandle: THandle;
ProcessID: DWORD;
ProcessHandle: THandle;

begin;
ProcessID:= GetCurrentProcessID;
ProcessHandle:= OpenProcess(PROCESS_SET_INFORMATION, false, ProcessID);
SetPriorityClass(ProcessHandle, REALTIME_PRIORITY_CLASS);
ThreadHandle:= GetCurrentThread;
SetThreadPriority(ThreadHandle, THREAD_PRIORITY_TIME_CRITICAL);
//---------------------------------------
//"ACTIVE INGREDIENT"/ENGINE HERE:
//---------------------------------------
try
Counter:=0;
AssignFile(F1, 'HOSTSFromFranceToInsert.txt');
Reset(F1);
AssignFile(F2, 'B:\HOSTS\NewNormalizedFinalMinusTrailingBlanksNEW EST.txt');
Rewrite(F2); //Blanks it out, so no need for FileUtils unit If FileExists stuff... apk
writeln(F2, Trim('Start Time = ' + Trim(TimeToStr(Now))));
while not Eof(F1) do
begin
Try

Counter:=Counter+1;
Readln(F1, Ch);
//writeln(IntToStr(Counter)); (GOOD FOR DEBUG, BUT, WRITES TO CONSOLE SCREEN slows execution to 40 seconds... apk}
//clrscr; {Nice for seeing it on same line updating, rather than row after row... apk}
Ch:= StringReplace(Ch, '127.0.0.1 ', '0.0.0.0 ', Flags); //vs. Spybot inserts of 127.0.0.1(TAB)URL{cr+lf}
Ch:= StringReplace(Ch, '127.0.0.1', '0.0.0.0', Flags);
Ch:= ReverseString(Ch); //StrRev C/C++ equivalent... apk
Ch:= StringReplace(Ch, ' ', '', Flags);
Ch:= ReverseString(Ch);
Ch:= StringReplace(Ch, '0.0.0.0', '0.0.0.0 ', Flags);
Ch:= StringReplace(Ch, '0.0.0.0 ', '0.0.0.0 ', Flags);
//Still considering a FOR loop here 1-4 interations... apk
Ch:= StringReplace(Ch, '"', '', Flags);
Ch:= StringReplace(Ch, '"', '', Flags);
Ch:= StringReplace(Ch, '"', '', Flags);
Ch:= StringReplace(Ch, '"', '', Flags);
//This extra FINALLY costs me around 3-5 seconds too, but worth it for data commit integrity... apk
finally
Writeln(F2, Trim(Ch));
end;
//---------------------------------------
//USING EXCESSIVE TRIMS, THOUGH GOOD FOR CODE SECURITY & DATA INTRGRITY TO AN EXTENT, SLOWS RUNTIME
//Up to 24 second levels, via lines much like this one below as an example:
//Ch:= StringReplace(Trim(Ch), Trim('0.0.0.0'), '0.0.0.0 ', Flags);
//Ch:= StringReplace(Trim(Ch), Trim('127.0.0.1'), Trim('0.0.0.0'), Flags);
//Ch:= StringReplace(Ch, Trim('"'), '', Flags);
//---------------------------------------
end;
//writeln(F2, Trim('End Time = ' + Trim(TimeToStr(Now))));
writeln(F2, 'End Time = ' + TimeToStr(Now));
//writeln(F2, Trim('Records Processed = ' + Trim(IntToStr(Counter))));
writeln(F2, 'Records Processed = ' + IntToStr(Counter));
CloseFile(F2);
Flush(F2); //clear memory buffer for output file... apk
CloseFile(F1);
Flush(F1); //clear memory buffer for input file... apk
except //CUSTOM EXCEPTION ABEND/ERR HANDLER I CREATED... apk
begin
CloseFile(F2);
Flush(F2); //clear memory buffer for output file... apk
CloseFile(F1);
Flush(F1); //clear memory buffer for input file... apk
exit;
end;
end;
end.

================================================== ==

apk
__________________
"I'm Reese: Sgt. TechComVN38416, assigned to protect you - You've been TARGETTED FOR TERMINATION!"

Last edited by APK; Jun 28, 2008 at 10:52pm.
APK is offline
Reply With Quote
View Public Profile Visit APK's homepage! Send a private message to APK
 
Old Jun 13, 2008, 06:23am Default Re: Today !
Flamingo Rinse's Avatar
Elite Member

Posts: 669
Name: nick
Karma: Flamingo Rinse will become famous soon enoughFlamingo Rinse will become famous soon enough
I shot a couple of troubled XP users today.
__________________
My Opera Blog
Flamingo Rinse is offline
Reply With Quote
View Public Profile Send a private message to Flamingo Rinse
 
Reply
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search





All times are GMT -4. The time now is 03:55am.

RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML


Copyright © 2006 - 2008 by The New Tech

vBulletin, Copyright © 2000-2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0 RC5