mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 12:07:27 +01:00
[DNM] Some absolute insanity performance hacks (#27204)
* Some absolute insanity performance hacks * Ok NOW its getting weird * Adds a way of verifying if this is working * Lets see how this goes * Build Rust library --------- Co-authored-by: paradisess13[bot] <165046124+paradisess13[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
paradisess13[bot] <165046124+paradisess13[bot]@users.noreply.github.com>
parent
a08dd177ba
commit
e1544141dd
@@ -24,6 +24,7 @@ _build_dependencies.sh @AffectedArc07
|
||||
# Executables that need to be security-cleared
|
||||
dreamchecker.exe @AffectedArc07
|
||||
rustlibs.dll @AffectedArc07
|
||||
rustlibs_prod.dll @AffectedArc07
|
||||
rust_g.dll @AffectedArc07
|
||||
|
||||
### S34NW
|
||||
|
||||
@@ -82,6 +82,10 @@ jobs:
|
||||
cp target/i686-unknown-linux-gnu/release/librustlibs.so ../tools/ci/librustlibs_ci.so
|
||||
cp target/i686-pc-windows-gnu/release/rustlibs.dll ../rustlibs.dll
|
||||
|
||||
# Build the para-specific version
|
||||
RUSTFLAGS='-C target-cpu=raptorlake' cargo build --release --target=i686-pc-windows-gnu
|
||||
cp target/i686-pc-windows-gnu/release/rustlibs.dll ../rustlibs_prod.dll
|
||||
|
||||
git commit -a -m "Build Rust library" --allow-empty
|
||||
git push origin
|
||||
|
||||
|
||||
+26
-10
@@ -8,6 +8,15 @@
|
||||
|
||||
/* This comment bypasses grep checks */ /var/__rustlib
|
||||
|
||||
// IF we are on the production box, use a dll that has 0 compatibility of working with normal people's CPUs
|
||||
// This works by allowing rust to compile with modern x86 instructionns, instead of compiling for a pentium 4
|
||||
// This has the potential for significant speed upgrades with SIMD and similar
|
||||
#ifdef PARADISE_PRODUCTION_HARDWARE
|
||||
#define RUSTLIBS_SUFFIX "_prod"
|
||||
#else
|
||||
#define RUSTLIBS_SUFFIX ""
|
||||
#endif
|
||||
|
||||
/proc/__detect_rustlib()
|
||||
if(world.system_type == UNIX)
|
||||
#ifdef CIBUILDING
|
||||
@@ -16,27 +25,34 @@
|
||||
return __rustlib = "tools/ci/librustlibs_ci.so"
|
||||
#endif
|
||||
// First check if it's built in the usual place.
|
||||
if(fexists("./rust/target/i686-unknown-linux-gnu/release/librustlibs.so"))
|
||||
return __rustlib = "./rust/target/i686-unknown-linux-gnu/release/librustlibs.so"
|
||||
if(fexists("./rust/target/i686-unknown-linux-gnu/release/librustlibs[RUSTLIBS_SUFFIX].so"))
|
||||
return __rustlib = "./rust/target/i686-unknown-linux-gnu/release/librustlibs[RUSTLIBS_SUFFIX].so"
|
||||
// Then check in the current directory.
|
||||
if(fexists("./librustlibs.so"))
|
||||
return __rustlib = "./librustlibs.so"
|
||||
if(fexists("./librustlibs[RUSTLIBS_SUFFIX].so"))
|
||||
return __rustlib = "./librustlibs[RUSTLIBS_SUFFIX].so"
|
||||
// And elsewhere.
|
||||
return __rustlib = "librustlibs.so"
|
||||
return __rustlib = "librustlibs[RUSTLIBS_SUFFIX].so"
|
||||
else
|
||||
// First check if it's built in the usual place.
|
||||
if(fexists("./rust/target/i686-pc-windows-msvc/release/rustlibs.dll"))
|
||||
return __rustlib = "./rust/target/i686-pc-windows-msvc/release/rustlibs.dll"
|
||||
if(fexists("./rust/target/i686-pc-windows-msvc/release/rustlibs[RUSTLIBS_SUFFIX].dll"))
|
||||
return __rustlib = "./rust/target/i686-pc-windows-msvc/release/rustlibs[RUSTLIBS_SUFFIX].dll"
|
||||
// Then check in the current directory.
|
||||
if(fexists("./rustlibs.dll"))
|
||||
return __rustlib = "./rustlibs.dll"
|
||||
if(fexists("./rustlibs[RUSTLIBS_SUFFIX].dll"))
|
||||
return __rustlib = "./rustlibs[RUSTLIBS_SUFFIX].dll"
|
||||
|
||||
// And elsewhere.
|
||||
return __rustlib = "rustlibs.dll"
|
||||
var/assignment_confirmed = (__rustlib = "rustlibs[RUSTLIBS_SUFFIX].dll")
|
||||
// This being spanned over multiple lines is kinda scuffed, but its needed because of https://www.byond.com/forum/post/2072419
|
||||
return assignment_confirmed
|
||||
|
||||
|
||||
#define RUSTLIB (__rustlib || __detect_rustlib())
|
||||
|
||||
#define RUSTLIB_CALL(func, args...) call_ext(RUSTLIB, "byond:[#func]_ffi")(args)
|
||||
|
||||
// This needs to go BELOW the above define, otherwise the BYOND compiler can make the above immediate call disappear
|
||||
#undef RUSTLIBS_SUFFIX
|
||||
|
||||
/proc/milla_init_z(z)
|
||||
return RUSTLIB_CALL(milla_initialize, z)
|
||||
|
||||
|
||||
@@ -91,6 +91,11 @@ GLOBAL_PROTECT(revision_info) // Dont mess with this
|
||||
msg += "<span class='notice'><b>Server Revision Info</b></span>"
|
||||
// Round ID first
|
||||
msg += "<b>Round ID:</b> [GLOB.round_id ? GLOB.round_id : "NULL"]"
|
||||
#ifdef PARADISE_PRODUCTION_HARDWARE
|
||||
msg += "<b>Production-hardware specific compile:</b> Yes"
|
||||
#else
|
||||
msg += "<b>Production-hardware specific compile:</b> No"
|
||||
#endif
|
||||
|
||||
// Commit info
|
||||
if(GLOB.revision_info.commit_hash && GLOB.revision_info.commit_date && GLOB.configuration.url.github_url)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user