Commit Graph

21 Commits

Author SHA1 Message Date
4b9a142a5d Import global functions and constants for enhanced performance
This is better for performance because these then don't need to be reevaluated every time they are called.

When encountering an unqualified function or constant reference, PHP will first try to locate a symbol in the current namespace by that name, and then fall back to the global namespace.
This short-circuits the check, which has substantial performance effects in some cases - in particular, ord(), chr() and strlen() show ~1500x faster calls when they are fully qualified.

However, this doesn't mean that PM is getting a massive amount faster. In real world terms, this translates to about 10-15% performance improvement.
But before anyone gets excited, you should know that the CodeOptimizer in the PreProcessor repo has been applying fully-qualified symbol optimizations to Jenkins builds for years, which is one of the reasons why Jenkins builds have better performance than home-built or source installations.
We're choosing to do this for the sake of future SafePHP integration and also to be able to get rid of the buggy CodeOptimizer, so that phar and source are more consistent.
2019-01-04 20:43:15 +00:00
c4c6c58615 Added some missing typehints 2018-06-10 17:18:55 +01:00
29fd26627e Level: Change isInWorld signature to use ints instead of floats
this is only used in one place, where it's being given floats, and it's 10% faster to use int for this because it won't convert it.

It is also 25% faster to remove typehints and 60% faster to inline it. We really need a proper PHP preprocessor for inlining.
2018-05-18 11:01:13 +01:00
4f8e4f0522 Add EOF newlines where missing (bulk) (#1836)
This should solve issues with people making GitHub PRs and having the web editor messing things up. GitHub Web Editor sucks :(
2017-12-20 11:56:36 +00:00
c8ed2406d7 Fix bad setChunk() documentation 2017-08-17 21:03:07 +01:00
c3b8be3f60 and more typehints 2017-07-14 10:56:51 +01:00
a365c831a8 Fixed some doc problems 2017-06-25 12:07:28 +01:00
0f79b19fdc Removed masks for Y coordinates, fixed bugs related to out-of-bounds coordinates, fixed #914 (#915) 2017-06-21 10:55:38 +01:00
8919d4a372 Some refactoring to allow for light updates to be executed asynchronously 2017-06-17 17:38:47 +01:00
75863e2a44 OCD commit 2017-06-07 12:54:12 +01:00
55791e0819 Fix doc formatting from FullChunk -> Chunk mass-replace 2017-01-03 22:24:28 +00:00
577dbbce1f Support 256-block build height and fixed world saving 2016-12-01 23:45:12 +00:00
ce289cbe25 Merge branch 'master' into 0.17-chunks 2016-12-01 17:50:12 +00:00
d6629d6843 More ?? (#131)
* More ??

* fix undefined variable
2016-11-30 10:07:37 +00:00
4c49db6036 New generic in-memory chunk format, fixed 0.17.0.1 chunk loading
Terrible performance, needs profiling. TODO: fix this.
2016-11-27 21:57:59 +00:00
58ff381557 PhpStorm automated formatting (#11)
* PhpStorm reformatting

* Tuned PhpStorm reformatting

* Improved ItemIds and BlockIds formatting

* Tuned more PhpStorm reformatting

* Improved string concatenation
2016-10-03 19:05:48 +08:00
eb00dee8a6 removed int return from getSeed 2016-02-22 13:03:27 +01:00
3ffdb8e552 Removed @deprecated classes, methods and properties, added some type hints 2015-09-12 17:10:11 +02:00
7ee21f6254 Try to clean chunks on other threads 2015-04-15 22:14:51 +02:00
e0522d8b1a Fixed data on generation, biome gradient 2015-03-27 12:42:59 +01:00
72c4c01542 Yay generation uses async tasks 2015-03-26 18:21:39 +01:00