This content from this markdown file has moved a new, happier home where it can serve more people. Please check it out : https://docs.microsoft.com/azure/azure-cache-for-redis/cache-best-practices.
| // Copyright 2016 People Gotta Play. All rights reserved. | |
| #include "ProjectMK.h" | |
| #include "UMGExtensionLibrary.h" | |
| UTextureRenderTarget2D * UUMGExtensionLibrary::RenderWidgetToTexture(bool UseGamma, TextureFilter Filter, UUserWidget * WidgetToRender, FVector2D DrawSize, float DeltaTime) | |
| { | |
| if (!WidgetToRender) return nullptr; | |
| if (DrawSize == FVector2D(0, 0)) return nullptr; |
| class Guard<T> : IDisposable where T : class { | |
| public Guard(T obj, Action<T> dispose) | |
| { | |
| obj_ = obj; | |
| dispose_ = dispose; | |
| disposed_ = false; | |
| } | |
| public void Dispose() |
| 1000 iterations, 10000 samples | |
| BitFields Style Pack: 00:00:00.0919455 | |
| BitFields Style Unpack: 00:00:00.3154235 | |
| BitConverter Pack: 00:00:00.0764927 | |
| BitConverter Unpack: 00:00:00.2149990 | |
| Direct Packing: 00:00:00.0325352 | |
| Direct Unpacking: 00:00:00.2034563 | |
| Direct Unpacking Unsafe:00:00:00.2150088 | |
| Access and Cast: 00:00:00.0308669 | |
| Access and Cast Back: 00:00:00.2004328 |
Because the build tools of UE4 works across platforms (Windows, Mac OS, Linux), steps in this article can be applied to Mac OS and Windows as well.
On Windows, You need to replace RunUAT.sh with RunUAT.bat though.
First, get Unreal Engine 4 sourcecode and export the following environment variables:
| #include "AnimatedImage.h" | |
| void UAnimatedImage::SetCurrentFrame(int32 Frame) | |
| { | |
| CurrentFrame = Frame; | |
| if (CurrentFrame < 0) CurrentFrame = 0; | |
| if (CurrentFrame > TotalFrames - 1) CurrentFrame = TotalFrames - 1; | |
| SynchronizeProperties(); | |
| } |
| // Fill out your copyright notice in the Description page of Project Settings. | |
| #include "LevelGeneration.h" | |
| #include "LevelManager.h" | |
| // Sets default values | |
| ALevelManager::ALevelManager() : | |
| MaxX(10), |
| ZigZag-Encoding | |
| --------------- | |
| Maps negative values to positive values while going back and | |
| forth (0 = 0, -1 = 1, 1 = 2, -2 = 3, 2 = 4, -3 = 5, 3 = 6 ...) | |
| (i >> bitlength-1) ^ (i << 1) | |
| with "i" being the number to be encoded, "^" being | |
| XOR-operation and ">>" would be arithemtic shifting-operation |
The CLR ThreadPool has two types of threads - "Worker" and "I/O Completion Port" (aka IOCP) threads.
- Worker threads are used when for things like processing
Task.Run(…)orThreadPool.QueueUserWorkItem(…)methods. These threads are also used by various components in the CLR when work needs to happen on a background thread. - IOCP threads are used when asynchronous IO happens (e.g. reading from the network).
The thread pool provides new worker threads or I/O completion threads on demand (without any throttling) until it reaches the "Minimum" setting for each type of thread. By default, the minimum number of threads is set to the number of processors on a system.
Once the number of existing (busy) threads hits the "minimum" number of threads, the ThreadPool will throttle the rate at which is injects new threads to one thread per 500 milliseconds. This means that if your system gets a burst of work needing an IOCP thread, it will proces
| #include "Test1.h" | |
| #include "PhysInstancedStaticMeshComponent.h" | |
| #include "PhysXIncludes.h" | |
| #include "PhysicsPublic.h" | |
| #include "Private/PhysicsEngine/PhysXSupport.h" | |
| UPhysInstancedStaticMeshComponent::UPhysInstancedStaticMeshComponent(const FObjectInitializer& initializer) | |
| : Super(initializer) | |
| { |