New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
time taken to compile information #147
Comments
|
I no have idea what this guy do, to make the pawn so fast. Reply from author: |
|
added the time code: YashasSamaga@c98411c |
|
You really shouldn't be optimising for compile times. I can still see compile time information being interesting, but if you are sacrificing your code (speed/readability/repetition/etc) for compile times quite frankly you are doing it wrong - compiles are done offline because they are slow. |
|
I obviously wouldn't give away readability or runtime performance to reduce the time taken to compile. When a part of the code slows the compiler down awfully lot, I'd actually try another method. |
|
I thought that files from the normal compiler and fast Russian compiler were the same, appears like they are not the same. Compiling the gamemode I'm working on takes about 30 seconds using the official compiler, and about 3 seconds using the Russian compiler. Would it be better to compile with the Russian compiler to debug, and to compile with the normal compiler for production? I'm saving so much time due to it normally taking 30 seconds to compile code, which can now be done in a couple seconds. |
|
My friend (i'm not scripting anymore) using russian version for my mode and it works without any problem. I suggest you to test it and you'll see. |
|
I am using the Russian compiler, but what I'd like to know what the downsides to that compiler is. |
|
I usually use an editor that tells me how much time it took to run the compiler, your editor could probably do the same with some addon/script. But that's if you simply want to know the total time. As for the fast compiler: I haven't tried it but does it compile something as complex as YSI as fast? |
|
@Zeex Could also use something like Linux's And I'm not sure about YSI, but it does compile the following includes very fast. #include <fuckcleo>
//include to load all defvars here
#include <fixes>
#include <timerfix>
#include <a_mysql>
#include <zcmd>
#include <irc>
#include <streamer>
#include <sscanf2>
#include <mSelection>
#include <FloodControl>
#include <SKY>
#include <weapon-config\weapon-config>
#include <SAMP-GeoIP\geolocation>
#include <samp-git-hash\git-hash.inc>
//include that includes all gamemode crap here |
|
I'm not sure how it handles YSI either, though I don't like the number of warnings it spits out for legitimate code (including |
|
Well I started doing some testing, and discovered that not only have they added new warnings, but they also removed the warning numbers from the error messages (why?) so I can't even see what number they've assigned to that stupid recursion warning to try and disable it - trial and error it is! |
|
@Y-Less I had the problem with the recursion as well. That was about 2 days ago. I didn't think much of it other than it being odd. |
|
While I don't think you should warn for legitimate code, the main problem is the lack of portability. It claims to be based on Zeex's compiler, but invented a new #if __Pawn >= 0x30A
#pragma warning push
#pragma warning disable 207
#pragma disablerecursion
#pragma warning pop
#endifIf you are on the original compiler, the whole block is skipped by the |
|
Also, the version reported by the compiler after a build is 3.2.3664, but |
|
I'll add that blob to |
|
@Y-Less, wouldn't it be better if only the specific version of the fast compiler would match the I'm assuming that they won't release a new version of the fast compiler. |
|
If there is no warning number, then it isn't a warning. AFAIK you cannot issue a warning without giving the warning number (the function used to trigger a warning in the compiler code is error(warn_or_err_number, format, ...); the warning number and message is added by the error function automatically. Whoever added that must have used pc_printf (or printf which is even worse) which isn't the correct way to issue a warning. You can confirm it by looking for "%d Warnings." at the end of the compiler message window. You should either get no total warnings message or the total warning count given must be one less than the actual count. |
|
@Jeroen52: Yes it would, but I don't know how to just select that one compiler since it gives the same version number as the other one. #include <a_samp>
forward MyFunc() <sss:hjk>;
MyFunc()
{
MyFunc();
}
main()
{
}Output: They've copied the |
|
You can find their complete warning message at 0x46b62d in .rdata So yeah, they broke the rules of issuing warnings. |
|
It would be very useful if that version was open-source so we could see how they got the speed and smooth out some of the quirks. |
|
@Y-Less: I have already sent an email a while ago, but haven't gotten a response yet. |
|
Holy shit my compile time went from ~120s to 12.~s tf? Lol, nonamenoname (SPAWN_METAL) said that he uses c++14 features in his version. |
|
C++14 is just a library, I don't think switching libraries make a significant difference. Moreover, Zeex might go against the idea of using C++14 because the code currently follows the C89 standards. |
|
fixed crash with #warning now it write about #pragma compat 0 if you have error with y_hooks function define gta-samp.com/files/pawncc.exe now it possible to disable recursion search with Also recursion from ziggi is wrong, it's mark nonrecursion functions warnings 217 (loose indentation) 203 (symbol is never used) & 204 (symbol is assigned a value that is never used) disabled as warning, only message. I changed this for VSCode, different sounds for no bugs/warnings/error. this warnings not bugs in code at all compat mode is enabled by default also there is other changes in compiler amx hex must be same as from this ver (not original from sa-mp.com) @Jeroen52 @Y-Less @karimcambridge @Zeex didn't answer about optimise on email & for thread #120 |
|
Symbol is never used is a mistake though, so should be a warning. If you know that a symbol is not being used theres both |
|
you still see this text |
|
@justnonamenoname Could you share the source code for it? It would make things much easier for everybody. |
|
It seems @justnonamenoname likes to take what others share open-source, but keep his own modifications to himself. Perhaps someone could follow the list of instructions he gave and try re-creating it? I don't know about you guys, but I personally don't like downloading binaries from sources I don't trust. |
|
I'm going to try using |
|
Could you not find an open-source C map library? Would make it simpler to get integrated and merged without porting. |
|
I already kinda did this here https://github.com/maddinat0r/pawn/commit/196fe1935239d71a9f2e91d1fac324ae6a6290fc. |
|
#120 so www.gta-samp.ru/files/PawnSource.rar |
|
Why shouldn't we migrate to C++? |
|
diff between versions: https://github.com/Zeex/pawn/compare/master...Southclaws:speed-optimised?expand=0 |
|
@YashasSamaga Why migrate to a whole new language because of ??? while we can introduce new bugs and possibly even break compatibility. |
|
@Jeroen52 We don't have to change all the C code to C++. We could just start compiling the project with a C++ compiler and use the C++ standard library. |
|
That's what maddinat0r is doing on his fork as far as I am aware. He said he managed to get his fork to run as fast as the Russian version. |
|
@Southclaws Are there any trade-offs? |
|
Not as far as I know, it's a proper fork of zeex' compiler maintaining the same source structure and proper warning handling so once it's ready, I'd advocate the use of it over the Russian version. |
|
I certainly will if it is backwards-compatible, however we must keep the number of different forks to a minimum and try to merge the new changes into Zeex/pawn. |
|
Yes that's our hope, but since maddinat0r's is a proper fork using GitHub it'll be much easier for zeex to review and merge with master. I don't think anyone wants a diverged fork since zeex' compiler is currently the de-facto standard for advanced Pawn users afaik. |
|
@Southclaws I can't wait for the new pull request. |
|
Okay, so I did find some possible incompatibilities with the Russian compiler and Zeex' compiler. It is a bit of code that does work on the Russian compiler, but not on Zeex' compiler. However it could be due to my shitty programming. |
|
I'd advise conforming to Zeex' compiler because it's widely used and well documented. If you write code that only works with the Russian one you're risking locking your code to that compiler only and if a major bug is discovered in the code, you'll need to do a bunch of extra work just to switch back. Also, it'll make getting help from others a lot more difficult. |
|
That is exactly what I'm doing, not only that but my Continuous Integration uses Zeex' compiler, so I was surprised when code I wrote on the Russian compiler didn't work when the gamemode was automatically updated. |
|
compat=1 default |


It would be useful if the compiler would display time taken to compile after a successful compilation so that we can optimize the code (preprocessor code?) for compile time.
Compiled in 5.344 seconds.If possible, it would be better if the compiler can tell how much each part of the compiling process took separately.
If needed, a new compiler flag can be added to show the time information.
I am not sure how someone can get the time taken accurately as there is no standard time library in C which provides a time resolution of milliseconds. The only way out is to use clock() but that is a dirty and messy function.
The text was updated successfully, but these errors were encountered: