- Home /
Unity Jobs and BURST low performance on Html5
Hi. I am trying a simple job to measure how big of a performance improvement I get. This is the related code:
[BurstCompile]
struct HardJob : IJob
{
public void Execute()
{
for (int i = 0; i < 10000; i++)
{
float result = Mathf.Exp(Mathf.Sqrt(i));
}
}
}
And then I just call it via:
NativeArray<JobHandle> arr = new NativeArray<JobHandle>(10000, Allocator.TempJob);
for (int i = 0; i < 10000; i++)
{
arr[i] = new HardJob().Schedule();
}
JobHandle.CompleteAll(arr);
arr.Dispose();
Performance results in the editor are AMAZING:
Without jobs: 160ms per excecution.
With Jobs: 16ms per excecution.
With BURST ™️ jobs: 0.16 ms per execution!
Aaaand then I tried HTML5
Without jobs: 180ms
With jobs 190 ms
With BURST ™️ : 195ms
Why is my HTML5 performance WORSE when using jobs? Did I forget to enable something in the build settings?
Answer by hameed-ullah-jan · Dec 16, 2019 at 06:32 AM
have you enabled the burst compilation? from Job>Burst>Enable Compilation
Yes, it is enabled.
$$anonymous$$aybe HT$$anonymous$$L5 is not supported?
Do you have a list of "supported" targets?
Your answer
Follow this Question
Related Questions
html not editable with UnityLoader.js 0 Answers
Set content of a custom tag of a WebGL template via script 0 Answers
WebGL - too much recursion browser error! 1 Answer
Itch.io webgl not uploading properly 1 Answer
Screen Recording in WebGL 0 Answers