Lua parsing vs. PxUtilities parser
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Lua parsing vs. PxUtilities parser

Started by bluebear, 17 April, 2006, 12:14:37

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bluebear

A test was made by me and mutor.

2 Lua 5.0.2 scripts, 1 uses pure lua to parse, 1 use PxUtilities.dll to parse.

Both script parsed 5.000.000 $ConnectToMe's

The results:
? Pure lua parsing:
? ? Duration: 34406 ms
? ? 00:00:34.406

? Parsing with PxUtilities:
? ? Duration: 8016 ms
? ? 00:00:08.016

The results shows that parsing DcCommands with PxUtilities is over 4 times faster than plain lua!
Means that I will add the full DC Command parser into this lib, and it should be used by all scripts to parse DC Commands with i think.
Sincerely,
bluebear
--
http://www.thewildplace.dk/ is is closed - Use the following mirrors instead
http://bluebear.psycho-chihuahua.net
http://pxextension.piratez.dk/
[Lua extensions - Chat stats - YnHub PMSpy - DC Source code - and more]

bastya_elvtars

So does this split up DC commands? Great. Happy Easter then.  ;D
Everything could have been anything else and it would have just as much meaning.

bluebear

For a command like $ConnectToMe it will be like this:

invalid, nick, IP, port = Parse.CTM(data)
if invalid then
? ?if invalid == 1 then
? ? ? -- Bad IP (out of range/and such)
? ?elseif invalid == 2 then
? ? ? -- IP is in a local range (eg. 192.168.*.*)
? ?elseif invalid == 3 then
? ? ? -- port number is out of range or otherwise invalid
? ?elseif invalid == 4 then
? ? ? -- Nickname is missing or this was not a $ConnectToMe
? ?end
else
? -- work with data
end

I just did some more speed tests.. On 5000 commands its only twice as fast, on 5.000.000 its 4 times faster, on 50.000.000 its 5 times faster..
The details of what the parser will check will depend on what ptokax already checked it self first...
For example, if ptokax it self checks if IP is correct then theres no need to do so in the lib.. The obove code was only a sample.. THis has not been coded yet, only for 1 command for the speed test :)
Sincerely,
bluebear
--
http://www.thewildplace.dk/ is is closed - Use the following mirrors instead
http://bluebear.psycho-chihuahua.net
http://pxextension.piratez.dk/
[Lua extensions - Chat stats - YnHub PMSpy - DC Source code - and more]

SMF spam blocked by CleanTalk