[Plugin] [REL] PointToPoint Plugin
#31

Whoa don't know how this one slipped under my radar for so long....just happened to be going through my IRC logs the other day and found a conversation from Blacklight talking about this.

For those not using this plugin here is a better example of the speed difference over pawns floatsqroot.

Using this benchmark script (Yom posted this on my random plugin...)
pawn Код:
#include <a_samp>
#include <pointtopoint>

#define BENCH_INIT(%1); new BT1=GetTickCount(),BT2,BI1,BI2=%1;

#define BENCH(%1(%2)); \
{\
  for(BI1=0;BI1<BI2;BI1++)\
    %1(%2);\
\
  BT2=GetTickCount();\
  BT1=BT2-BT1;\
\
  printf("\n"#%1"\n -> Average time per call : %8.f ns\n -> Total execution time : %8d ms\n -> Calls per second   : %8.f calls",\
  (float(BT1)/BI2)*1000000,BT1,(float(BI2)/BT1)*1000);\
\
  BT1=BT2;\
}

main()
{
  BENCH_INIT(500000);
  BENCH(floatsqroot((2579.6860 - 708.1278) * (2579.6860 - 708.1278) + (-1220.7325 - -1634.9844) * (-1220.7325 - -1634.9844) + (54.7770 - 4.1586) * (54.7770 - 4.1586)));
  BENCH(floatsqroot((2579.6860 - 708.1278) * (2579.6860 - 708.1278) + (-1220.7325 - -1634.9844) * (-1220.7325 - -1634.9844) + (54.7770 - 4.1586) * (54.7770 - 4.1586)));
  BENCH(PointToPoint3D(2579.6860, -1220.7325, 54.7770, 708.1278, -1634.9844, 4.1586));
  BENCH(PointToPoint3D(2579.6860, -1220.7325, 54.7770, 708.1278, -1634.9844, 4.1586));
  BENCH(floatsqroot((2579.6860 - 708.1278) * (2579.6860 - 708.1278) + (-1220.7325 - -1634.9844) * (-1220.7325 - -1634.9844) + (54.7770 - 4.1586) * (54.7770 - 4.1586)));
  BENCH(floatsqroot((2579.6860 - 708.1278) * (2579.6860 - 708.1278) + (-1220.7325 - -1634.9844) * (-1220.7325 - -1634.9844) + (54.7770 - 4.1586) * (54.7770 - 4.1586)));
  BENCH(PointToPoint3D(2579.6860, -1220.7325, 54.7770, 708.1278, -1634.9844, 4.1586));
  BENCH(PointToPoint3D(2579.6860, -1220.7325, 54.7770, 708.1278, -1634.9844, 4.1586));
  printf("Result of floatsqroot: %.4f", floatsqroot((2579.6860 - 708.1278) * (2579.6860 - 708.1278) + (-1220.7325 - -1634.9844) * (-1220.7325 - -1634.9844) + (54.7770 - 4.1586) * (54.7770 - 4.1586)));
  printf("Result of PointToPoint3D: %.4f", PointToPoint3D(2579.6860, -1220.7325, 54.7770, 708.1278, -1634.9844, 4.1586));

Here are the results....

Код:
[18:39:13]
floatsqroot
 -> Average time per call :      668 ns
 -> Total execution time :      334 ms
 -> Calls per second   :  1497006 calls
[18:39:13]
floatsqroot
 -> Average time per call :      654 ns
 -> Total execution time :      327 ms
 -> Calls per second   :  1529052 calls
[18:39:14]
PointToPoint3D
 -> Average time per call :      144 ns
 -> Total execution time :       72 ms
 -> Calls per second   :  6944444 calls
[18:39:14]
PointToPoint3D
 -> Average time per call :      144 ns
 -> Total execution time :       72 ms
 -> Calls per second   :  6944444 calls
[18:39:14]
floatsqroot
 -> Average time per call :      668 ns
 -> Total execution time :      334 ms
 -> Calls per second   :  1497006 calls
[18:39:14]
floatsqroot
 -> Average time per call :      666 ns
 -> Total execution time :      333 ms
 -> Calls per second   :  1501501 calls
[18:39:14]
PointToPoint3D
 -> Average time per call :      144 ns
 -> Total execution time :       72 ms
 -> Calls per second   :  6944444 calls
[18:39:14]
PointToPoint3D
 -> Average time per call :      146 ns
 -> Total execution time :       73 ms
 -> Calls per second   :  6849315 calls
[18:39:14] Result of floatsqroot: 1917.5236
[18:39:14] Result of PointToPoint3D: 1917.5236
Reply


Messages In This Thread
[REL] PointToPoint Plugin - by StrickenKid - 24.01.2010, 23:35
Re: [REL] PointToPoint Plugin - by pliva_sb - 24.01.2010, 23:49
Re: [REL] PointToPoint Plugin - by StrickenKid - 24.01.2010, 23:53
Re: [REL] PointToPoint Plugin - by GTA967 - 25.01.2010, 00:25
Re: [REL] PointToPoint Plugin - by joemomma53 - 25.01.2010, 00:38
Re: [REL] PointToPoint Plugin - by Jay_ - 25.01.2010, 10:28
Re: [REL] PointToPoint Plugin - by [03]Garsino - 02.03.2010, 18:59
Re: [REL] PointToPoint Plugin - by BeckzyBoi - 15.03.2010, 05:29
Re: [REL] PointToPoint Plugin - by Deat_Itself - 15.03.2010, 14:39
Re: [REL] PointToPoint Plugin - by BeckzyBoi - 21.03.2010, 22:43
Re: [REL] PointToPoint Plugin - by Jay_ - 21.03.2010, 23:25
Re: [REL] PointToPoint Plugin - by Brian_Furios - 22.03.2010, 19:29
Re: [REL] PointToPoint Plugin - by DiDok - 29.03.2010, 22:34
Re: [REL] PointToPoint Plugin - by Chaprnks - 30.03.2010, 02:31
Re: [REL] PointToPoint Plugin - by ping - 21.04.2010, 11:56
Re: [REL] PointToPoint Plugin - by Stas92 - 21.04.2010, 12:23
Re: [REL] PointToPoint Plugin - by Fro1sha - 08.05.2010, 10:38
Re: [REL] PointToPoint Plugin - by Trooper[Y] - 16.06.2010, 14:53
Re: [REL] PointToPoint Plugin - by bpeterson - 16.06.2010, 17:32
Re: [REL] PointToPoint Plugin - by Trooper[Y] - 16.06.2010, 21:14
Re: [REL] PointToPoint Plugin - by bpeterson - 17.06.2010, 09:38
Re: [REL] PointToPoint Plugin - by jonrb - 15.07.2010, 09:53
Re: [REL] PointToPoint Plugin - by ft941 - 03.08.2010, 16:50
AW: [REL] PointToPoint Plugin - by Bubelbub - 19.01.2011, 14:48
Re: [REL] PointToPoint Plugin - by kurta999 - 19.01.2011, 15:25
Re: [REL] PointToPoint Plugin - by HyperZ - 19.01.2011, 16:07
Re: [REL] PointToPoint Plugin - by WillyP - 19.01.2011, 16:31
Re: [REL] PointToPoint Plugin - by snoob - 19.01.2011, 17:35
Re: [REL] PointToPoint Plugin - by Elviss - 19.01.2011, 17:57
Re: [REL] PointToPoint Plugin - by Burridge - 19.01.2011, 18:46
Re: [REL] PointToPoint Plugin - by cyber_punk - 19.01.2011, 22:40
Re: [REL] PointToPoint Plugin - by Mike Garber - 20.01.2011, 08:14
Re: [REL] PointToPoint Plugin - by Elviss - 20.01.2011, 10:47
Re: [REL] PointToPoint Plugin - by Slice - 20.01.2011, 11:02
Re: [REL] PointToPoint Plugin - by Double-O-Seven - 20.01.2011, 16:23
Re: [REL] PointToPoint Plugin - by Hiddos - 20.01.2011, 17:10
Re: [REL] PointToPoint Plugin - by [Ask]Terminator - 20.01.2011, 18:13
Re: [REL] PointToPoint Plugin - by Slice - 21.01.2011, 08:49
Re: [REL] PointToPoint Plugin - by Minokon - 21.01.2011, 19:48
Re: [REL] PointToPoint Plugin - by kurta999 - 21.01.2011, 20:12
AW: [REL] PointToPoint Plugin - by Akmet - 22.01.2011, 10:44
Re: [REL] PointToPoint Plugin - by lpiob - 04.02.2011, 13:58
Re: [REL] PointToPoint Plugin - by Hal - 18.03.2011, 19:26
Re: [REL] PointToPoint Plugin - by cyber_punk - 15.04.2011, 06:24
Re: [REL] PointToPoint Plugin - by VIRUXE - 02.08.2011, 00:25
Re: [REL] PointToPoint Plugin - by Blacklite - 02.08.2011, 00:32
Re: [REL] PointToPoint Plugin - by Famalamalam - 02.08.2011, 01:19
Re: [REL] PointToPoint Plugin - by Gamer_Z - 02.08.2011, 08:40
Re: [REL] PointToPoint Plugin - by Famalamalam - 02.08.2011, 13:15
Re: [REL] PointToPoint Plugin - by Blacklite - 16.08.2011, 06:51
Re: [REL] PointToPoint Plugin - by BeckzyBoi - 16.08.2011, 07:11
Re: [REL] PointToPoint Plugin - by GangsTa_ - 16.08.2011, 08:45
Re: [REL] PointToPoint Plugin - by Blacklite - 16.08.2011, 10:19
[No subject] - by ][Noname][ - 13.04.2012, 00:54
Re: [REL] PointToPoint Plugin - by -Prodigy- - 13.04.2012, 01:43
Re: [REL] PointToPoint Plugin - by JM_Millers - 17.04.2012, 16:49
Re: [REL] PointToPoint Plugin - by BeckzyBoi - 17.04.2012, 17:10
Re: [REL] PointToPoint Plugin - by Jay_ - 17.04.2012, 17:50
[No subject] - by ][Noname][ - 18.04.2012, 09:03
Re: [REL] PointToPoint Plugin - by Blacklite - 19.04.2012, 10:17
Re: [REL] PointToPoint Plugin - by pawlak - 01.11.2012, 16:39
Re: [REL] PointToPoint Plugin - by NoahF - 01.11.2012, 21:14

Forum Jump:


Users browsing this thread: 1 Guest(s)