Jump to content

chemicalbliss

Member
  • Content Count

    5
  • Joined

  • Last visited

  • Medals

Community Reputation

10 Good

About chemicalbliss

  • Rank
    Rookie
  1. Hi ViseVersa, None taken at all - although I would appreciate some details about how it could be improved and why a while loop would of been better? I've sent a PM in case you don't see this message, sorry for necroing this topic but if there is something I'm doing wrong/inefficiently I would like to know what it is. Thanks!
  2. Pretty sure arma 2 will not be developed further. Some things don't change. Objects not found could be anything, seeing as it is the server RPT it is the server cannot find those objects. Some objects in missions files, perhaps slots or default engine parameters for maps and missions can show these as "errors" when they should be just "notices". Others are network lag related, just showing you there was (for a short period) a problem finding/tracking a specific object. In arma, you debug symptoms, unless you have noticeable server lag or desync then there is nothing to worry about (unless you get specific sqf or config errors). sometimes it is the clients bandwidth that can cause issues, in which case there is nothing you can do about that. The only way to get a clean log is to log stuff yourself and switch off default logging with -nologs. This however, depending on your needs, could be useless, or a daunting task. However, an RPT even a few hundred mb in size should not adversely affect the performance of the server, the server doesnt read the rpt, it simple appends to it. IMO the easiest option is to regex relpace bogus log lines (clean the rpt) using a simple regex string replace program (notepad++ has this). Apart from that, move to arma 3, more likely they will develop the logging functionality further in newer builds.
  3. Thanks gc but this is regarding arma 2. I mentioned the select method for a3 in my post maybe you didnt see. And for a game its all about performance. I cant see any downside atm. For ex, there will be other functions that may be sped up by this method. Will test more.
  4. The way this is setup includes the time it takes to call the extension. It would appear the evidence shows this is quicker than the sqf version even in single usage. I also cant find any standard BIS substr function (arma 2)? Also cannot find any pre-written example of substr for arma 2, only methods using select with arma 3.
  5. I guys and gals, I've been working on learning sqf performance so I can write the fastest addoon possible (No db lag or sqf scheduler overruns). Please dont say anything about premature optimization etc, this is what I'm doing :). So, I have noticed SQF functions in Arma 2 at least are quite.. shall I say.. Snail pace, compared to true compiled function eg c++. Now whether it is how it is compiled/gc'd or w/e that's not he point. I have noticed almost any function I make in arma 2 sqf is orders of magnitude slower than what I can write and use using an extension dll in c++. A simple substr function for example; For example, in the C++ DLL extension: if (tPacket->Method == "substr") { size_t start = utilStringToInt_(tPacket->Data.substr(0, 5)); size_t length = utilStringToInt_(tPacket->Data.substr(6, 5)); std::string strData = tPacket->Data.substr(12); result = (length != 0)? strData.substr(start, length) : strData.substr(start); } in SQF: (Limited knowledge of SQF commands this is the most efficient method I could create.) fnc_substr = { private["_string","_strArray","_stringsub","_start","_length", "_tempstr"]; _string = _this select 0; _strArray = toArray _string; _start = _this select 1; _length = _this select 2; if (_length == 0) then { _length = (count _strArray) - _start; // from start to end }; _end = _start + _length; _stringsub = ""; _tempstr = ""; for "_i" from _start to _end-1 do { _tempstr = toString [_strArray select _i]; _stringsub = format ["%1%2", _stringsub, _tempstr]; }; _stringsub; }; The Test Code: // dll func bench _diagTickBegin = diag_tickTime; for "_t" from 0 to 10000 do { _temphandle = "cb_ff_dbi" callExtension "int|name"; _directResp = "cb_ff_dbi" callExtension format ["fnc|substr|00013,00000,%1", _temphandle]; //diag_log(format ["cb_ff_dbi name: %1", _directResp]); _temphandle = "cb_ff_dbi" callExtension "int|version"; _directResp = "cb_ff_dbi" callExtension format ["fnc|substr|00013,00000,%1", _temphandle]; //diag_log(format ["cb_ff_dbi version: %1", _directResp]); _temphandle = "cb_ff_dbi" callExtension "int|author"; _directResp = "cb_ff_dbi" callExtension format ["fnc|substr|00013,00000,%1", _temphandle]; //diag_log(format ["cb_ff_dbi author: %1", _directResp]); }; _diagTickEnd = diag_tickTime; diag_log(format ["cb_ff_dbi::Controller->fnc_substr(): %1", _diagTickEnd - _diagTickBegin]); // sqf func bench _diagTickBegin = diag_tickTime; for "_t" from 0 to 10000 do { _temphandle = "cb_ff_dbi" callExtension "int|name"; _ticketedata = [_temphandle, 13, 0] call fnc_substr; //diag_log(format ["cb_ff_dbi name: %1", _ticketedata]); _temphandle = "cb_ff_dbi" callExtension "int|version"; _ticketedata = [_temphandle, 13, 0] call fnc_substr; //diag_log(format ["cb_ff_dbi version: %1", _ticketedata]); _temphandle = "cb_ff_dbi" callExtension "int|author"; _ticketedata = [_temphandle, 13, 0] call fnc_substr; //diag_log(format ["cb_ff_dbi author: %1", _ticketedata]); }; _diagTickEnd = diag_tickTime; diag_log(format ["sqf::main::fnc_substr(): %1", _diagTickEnd - _diagTickBegin]); The Results: 20:39:51 "cb_ff_dbi::Controller->fnc_substr(): 2.132" 20:40:19 "sqf::main::fnc_substr(): 28.105" So, now I want to write all my expensive sorting and expressive functions in a client DLL so the client can benefit from that performance gain. The thing is, BE Blocks DLL's it doesnt know (I'm assuming some kind of whitelist?). So my question is, how can I whitelist a DLL (and possible even variations on that DLL for updates). I wonder if CBA has such a white-listed helper dll like this. Also, is this actually a good idea? (I dont care about players having to download dll or mod files etc or security, that is my own concern). Thanks!
×