Commit Graph

52 Commits

Author SHA1 Message Date
RoosterDragon
d1b3d77662 Changed logging in DoTimed/RunActivity to create less overhead.
- Refactored PerfTimer to use less memory.
- Avoid using the PerfTimer in highly called methods DoTimed and RunActivity, instead tracking long ticks manually to reduce overhead and avoid memory allocations.
- Added some helper methods in PerfTimer to output information when a tick takes too long.
- Changed PerfTimer logging to output the time at the start of the line, and no longer truncate output per line.
- Settings.LongTickThreshold changed from TimeSpan to float and renamed to LongTickThresholdMs.
2014-05-28 16:38:05 +01:00
RoosterDragon
b733465f33 General uncontroversial cleanup:
- Made private methods static where possible (runtime can elide checking the object for null).
- Declared attribute classes as sealed (allows reflection on attributes to complete faster).
- Moved some static cctor's into field initializers (static cctor's are slower than static field initializers).
- Made classes static if they contained only static methods (can't create instances of useless objects).
- Use inferable Exts.Lazy and not new Lazy<T>().
- Added required STAThread attribute to CrashDialog.
- Removed unused parameters in private methods.
- Added Serializable attribute to exceptions.
- Added parameter name in calls to ArgumentNullException.
- Use of as operator instead of is + cast.
- Changed (x as Foo).Bar anti-pattern into ((Foo)x).Bar. Results in sensible cast exceptions on error rather than null dereferences.
- Removed unused method in NullShader.
2014-05-23 15:50:54 +01:00
Pavlos Touboulidis
df0d1360dd Give PerfTimer the ability to write only slow operations to the log
This is useful to ignore fast operations that just spam the log.

The class had to be reworked because it couldn't properly handle cases
where all of a node's children where below the threshold.

Also changed DoTimed() and RunActivity() to use PerfTimer.
2014-05-22 03:40:36 +03:00
Matthias Mailänder
187362e80e rename OpenRA.Support.Random aka XRandom to MersenneTwister 2014-05-18 21:53:21 +02:00
Matthias Mailänder
59ace5d01b new shorthand Exts.(Try)ParseIntegerInvariant 2014-05-13 14:16:41 +02:00
Matthias Mailänder
b19d286f56 parse with NumberFormatInfo.InvariantInfo everywhere
closes #5240
2014-05-06 18:31:48 +02:00
Paul Chote
3965535f3f Remove Windows.Forms dependencies from game and utility. Fixes #4348. 2014-05-04 09:37:25 +12:00
Paul Chote
fe6831a095 Move winforms crash dialog into an external helper. 2014-05-04 09:37:25 +12:00
Pavlos Touboulidis
c28faffa45 Remove custom Stopwatch wrapper
Remove the redirection (that doesn't offer any new functionality)
and replace it with the familiar System.Diagnostics.Stopwatch.
2014-04-26 23:58:18 +03:00
Pavlos Touboulidis
e6dddf3704 Style fixes 2014-04-26 02:05:06 +03:00
Pavlos Touboulidis
603dd1d866 Style fixes 2014-04-24 13:46:06 +03:00
Pavlos Touboulidis
c17f706772 Prettier PerfTimer output 2014-04-23 16:52:52 +03:00
Pavlos Touboulidis
36a660385c Fix OpenRA.Lint throwing because "perf" log channel does not exist
Slightly modified the Log class to allow dummy channels that don't
write anywhere, then use it on Lint because map loading writes to
the "perf" channel.
2014-04-23 13:22:14 +03:00
Pavlos Touboulidis
c44d73d581 Improve PerfTimer output 2014-04-23 03:42:27 +03:00
Pavlos Touboulidis
60732bd9bd Repurpose unused Timer.cs and add some loading perf metrics 2014-04-23 01:58:30 +03:00
Pavlos Touboulidis
035834978d Make Stopwatch.ElapsedTime() a property and TimeSpan 2014-04-23 00:56:07 +03:00
Paul Chote
4935266945 Merge FileFormats dll into Game and reorganise namespaces. 2014-04-17 01:20:47 +12:00
Paul Chote
6d6d1e230b Remove runtime mod merging. Closes #3421. 2013-11-15 09:54:42 +13:00
ScottNZ
1394c1dcee Remove some misc redundancies 2013-11-12 19:39:39 +13:00
Paul Chote
6aee253c94 Fix a NRE in the exception handler. 2013-11-09 15:24:58 +13:00
Matthias Mailänder
70ba7fe5f6 added OpenRA, OS and .NET/Mono runtime version to exception.log 2013-10-17 20:39:41 +02:00
ScottNZ
b654b65d8d Close game interface before showing crash form and don't show it at all on dedicated servers. 2013-08-29 01:30:29 +12:00
ScottNZ
7f67b567f9 Add Fatal Error dialog 2013-08-18 14:58:07 +12:00
Scott_NZ
da0b4ecd3b Log unhandled exceptions 2013-05-02 23:45:05 +12:00
James Dunne
e49a439c79 You win chrisf =P 2012-07-03 19:05:46 -05:00
James Dunne
b2e9085371 More detailed exception reporting on crash. 2012-07-03 15:37:37 -05:00
Chris Forbes
325ec41182 remove dead functions from Arguments.cs 2011-10-18 21:58:17 +13:00
Chris Forbes
55036cd58c fix trailing whitespace everywhere 2011-09-26 08:40:39 +13:00
Paul Chote
be79529d9e Perf debug 2011-05-21 17:26:15 +12:00
Paul Chote
094907c1a9 Update copyright header. Normalize line endings to LF. 2011-02-13 10:38:57 +13:00
Chris Forbes
c3c16c4fd8 remove some duplication in Utility 2011-02-05 11:54:31 +13:00
Chris Forbes
cf17bc7e5c clean up perf graph a bit 2010-12-31 20:31:57 +13:00
Paul Chote
e81a1f78a4 Fix visibility that mono 2.8 happily ignores. 2010-11-27 22:39:50 +13:00
Bob
0d9cf63dd2 move Mobile et al into Mods/ 2010-10-22 11:31:13 +13:00
Bob
c0d0636e08 store traits differently (index on trait class rather than actor) 2010-08-26 19:32:59 +12:00
Paul Chote
46d0ce89e9 Fix silly naming conventions 2010-08-24 19:53:05 +12:00
Paul Chote
cb3f6435ad Kill broken log uploading 2010-08-18 20:45:30 +12:00
alzeih
b8a335a88f put back in --just-die 2010-07-20 21:38:21 +12:00
alzeih
f92b59e6db Developer Mode (pchote: amended) 2010-07-20 21:20:03 +12:00
Chris Forbes
d5f12dd8ee trim down license spam in all files 2010-07-18 16:48:21 +12:00
Paul Chote
fdc85b6e48 Don't spam logs and replays all over my home directory kthx.
Logs and replays are written to subdirectories of the "Support" folder. Default location is <game dir>/Support/; Can be overridden on game start.
2010-07-08 18:11:28 +12:00
Chris Forbes
3c95a2886c hack hack 2010-06-13 00:04:14 +12:00
Chris Forbes
ee0f90708f put perf in its own channel 2010-06-11 18:15:59 +12:00
Matthew Bowra-Dean
aa239d172d Log channels, PHP script diffs when told. 2010-06-10 12:50:22 +12:00
Matthew Bowra-Dean
5f48577ebc upload.php now groups log files into zip files by game ID. 2010-06-10 12:48:06 +12:00
Matthew Bowra-Dean
fd014e15a5 Support for master game ID. 2010-06-10 12:45:58 +12:00
Matthew Bowra-Dean
e7c7a117a8 Log uploading. 2010-06-10 12:43:45 +12:00
Chris Forbes
c944013cfb globally fix number parsing on non-english systems 2010-04-28 08:19:54 +12:00
Bob
55352d7df9 merge Game.Init into PreInit; fix exploit involving chrome.CheckDeadTab; fixed cancel behaviour wrt canceling an item not currently in the queue (because of orderlag, etc) 2010-04-16 14:18:30 +12:00
Paul Chote
559a0107fe Perf debug as widgets 2010-04-11 13:49:37 +12:00