Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions JetStreamDriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -1608,6 +1608,7 @@ class AsyncBenchmark extends DefaultBenchmark {

performance.measure(iterationMarkLabel, iterationMarkLabel);

benchmark.postIteration?.(i);
${this.postIterationCode}

results.push(Math.max(1, end - start));
Expand Down Expand Up @@ -2692,7 +2693,7 @@ let BENCHMARKS = [
BUNDLE: "./babylonjs/dist/bundle.es5.min.js",
},
args: {
expectedCacheCommentCount: 23988,
expectedCacheCommentCount: 23992,
},
tags: ["startup", "js", "class", "es5", "babylonjs"],
iterations: 10,
Expand All @@ -2707,7 +2708,7 @@ let BENCHMARKS = [
BUNDLE: "./babylonjs/dist/bundle.es6.min.js",
},
args: {
expectedCacheCommentCount: 21222,
expectedCacheCommentCount: 21225,
},
tags: ["Default", "js", "startup", "class", "es6", "babylonjs"],
iterations: 10,
Expand Down
10 changes: 9 additions & 1 deletion babylonjs/benchmark/scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class Benchmark {
cannonData: null,
particlesJson: null,
};
sceneDisposer;

constructor(iterationCount) {
this.iterationCount = iterationCount;
Expand All @@ -54,12 +55,13 @@ class Benchmark {
}

async runIteration() {
const {classNames, cameraRotationLength} = await BabylonJSBenchmark.runComplexScene(
const {classNames, cameraRotationLength, disposer} = await BabylonJSBenchmark.runComplexScene(
this.preloaded.fortData,
this.preloaded.cannonData,
this.preloaded.particlesJson,
100
);
this.sceneDisposer = disposer;
const lastResult = {
classNames,
cameraRotationLength
Expand All @@ -76,4 +78,10 @@ class Benchmark {
if (value != expected)
throw new Error(`Expected ${name} to be ${expected}, but got ${value}`);
}

postIteration() {
// FIXME: move to measured phase.
this.sceneDisposer();
}
}

9 changes: 8 additions & 1 deletion babylonjs/benchmark/startup.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

class Benchmark extends StartupBenchmark {
iteration = 0;
sceneDisposer;

constructor({iterationCount, expectedCacheCommentCount}) {
super({
Expand All @@ -47,7 +48,8 @@ class Benchmark extends StartupBenchmark {
eval(sourceCode);
// const runStart = performance.now();

const { classNames, cameraRotationLength } = BabylonJSBenchmark.runTest(30);
const { classNames, cameraRotationLength, disposer} = BabylonJSBenchmark.runTest(30);
this.sceneDisposer = disposer;
const lastResult = {
classNames,
cameraRotationLength,
Expand Down Expand Up @@ -80,4 +82,9 @@ class Benchmark extends StartupBenchmark {
if (value != expected)
throw new Error(`Expected ${name} to be ${expected}, but got ${value}`);
}

postIteration() {
// FIXME: move to measured phase.
this.sceneDisposer();
}
}
50 changes: 25 additions & 25 deletions babylonjs/dist/LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1487,7 +1487,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

The following npm package may be included in this product:

- @babylonjs/loaders@8.23.1
- @babylonjs/core@8.23.0

This package contains the following license:

Expand Down Expand Up @@ -1563,11 +1563,34 @@ In no event and under no legal theory, whether in tort (including negligence), c

While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.

With the following notices:

Babylon.js
Copyright 2023 The Babylon.js team

The following components are included in this package:

Draco Compression [v1.5.6](https://github.com/google/draco/tree/1.5.6)
https://github.com/google/draco
Licensed under the Apache 2.0 License

Basis transcoder
Copyright 2024 The Khronos Group (https://www.khronos.org/),
Licensed under the Apache 2.0 license.

GLSLang [v11.8.0](https://github.com/KhronosGroup/glslang/releases/tag/11.8.0)
Copyright 2024 The Khronos Group (https://www.khronos.org/),
Licensed under the Apache 2.0 license.

TWGSL (https://github.com/BabylonJS/twgsl)
Copyright 20221-2024 The Babylon.js team
Licensed under the Apache 2.0 License

-----------

The following npm package may be included in this product:

- @babylonjs/core@8.23.0
- @babylonjs/loaders@8.23.1

This package contains the following license:

Expand Down Expand Up @@ -1643,29 +1666,6 @@ In no event and under no legal theory, whether in tort (including negligence), c

While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.

With the following notices:

Babylon.js
Copyright 2023 The Babylon.js team

The following components are included in this package:

Draco Compression [v1.5.6](https://github.com/google/draco/tree/1.5.6)
https://github.com/google/draco
Licensed under the Apache 2.0 License

Basis transcoder
Copyright 2024 The Khronos Group (https://www.khronos.org/),
Licensed under the Apache 2.0 license.

GLSLang [v11.8.0](https://github.com/KhronosGroup/glslang/releases/tag/11.8.0)
Copyright 2024 The Khronos Group (https://www.khronos.org/),
Licensed under the Apache 2.0 license.

TWGSL (https://github.com/BabylonJS/twgsl)
Copyright 20221-2024 The Babylon.js team
Licensed under the Apache 2.0 License

-----------

The following npm packages may be included in this product:
Expand Down
17 changes: 13 additions & 4 deletions babylonjs/dist/bundle.es5.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -50485,9 +50485,12 @@ e({mode:0,data:n.buffer,sh:n.sh,faces:u,hasVertexColors:!1,compressed:!0,rawSpla
e({mode:A,data:n.buffer,sh:n.sh,faces:u,hasVertexColors:!!_,compressed:!1,rawSplat:!1})});case 7:return t.a(2,t.v)}},t)}));return function(e){
/*ThouShaltNotCache*/
return t.apply(this,arguments)}}())},e}();rQe._DefaultLoadingOptions={keepInRam:!1,flipY:!1},dj(new rQe);var iQe=n(48258);function oQe(){/*ThouShaltNotCache*/var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){/*ThouShaltNotCache*/var u=r&&r.prototype instanceof s?r:s,c=Object.create(u.prototype);return aQe(c,"_invoke",function(n,r,i){/*ThouShaltNotCache*/var o,s,u,c=0,l=i||[],f=!1,h={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){/*ThouShaltNotCache*/return o=t,s=0,u=e,h.n=n,a}};function d(n,r){/*ThouShaltNotCache*/for(s=n,u=r,t=0;!f&&c&&!i&&t<l.length;t++){var i,o=l[t],d=h.p,p=o[2];n>3?(i=p===r)&&(u=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=d&&((i=n<2&&d<o[1])?(s=0,h.v=r,h.n=o[1]):d<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,h.n=p,s=0))}if(i||n>1)return a;throw f=!0,r}return function(i,l,p){/*ThouShaltNotCache*/if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,p),s=l,u=p;(t=s<2?e:u)||!f;){o||(s?s<3?(s>1&&(h.n=-1),d(s,u)):h.n=u:h.v=u);try{if(c=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(f=h.n<0)?u:n.call(r,h))!==a)break}catch(t){o=e,s=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,i,o),!0),c}var a={};function s(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(aQe(t={},r,function(){/*ThouShaltNotCache*/return this}),t),f=c.prototype=s.prototype=Object.create(l);function h(e){/*ThouShaltNotCache*/return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,aQe(e,i,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,aQe(f,"constructor",c),aQe(c,"constructor",u),u.displayName="GeneratorFunction",aQe(c,i,"GeneratorFunction"),aQe(f),aQe(f,i,"Generator"),aQe(f,r,function(){/*ThouShaltNotCache*/return this}),aQe(f,"toString",function(){/*ThouShaltNotCache*/return"[object Generator]"}),(oQe=function(){/*ThouShaltNotCache*/return{w:o,m:h}})()}function aQe(e,t,n,r){/*ThouShaltNotCache*/ /*ThouShaltNotCache*/var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}aQe=function(e,t,n,r){/*ThouShaltNotCache*/ /*ThouShaltNotCache*/function o(t,n){/*ThouShaltNotCache*/ /*ThouShaltNotCache*/aQe(e,t,function(e){/*ThouShaltNotCache*/ /*ThouShaltNotCache*/return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},aQe(e,t,n,r)}function sQe(e,t,n,r,i,o,a){/*ThouShaltNotCache*/try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function uQe(e){/*ThouShaltNotCache*/return function(){/*ThouShaltNotCache*/var t=this,n=arguments;return new Promise(function(r,i){/*ThouShaltNotCache*/var o=e.apply(t,n);function a(e){/*ThouShaltNotCache*/sQe(o,r,i,a,s,"next",e)}function s(e){/*ThouShaltNotCache*/sQe(o,r,i,a,s,"throw",e)}a(void 0)})}}function cQe(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,n=Object.keys(e);
/*ThouShaltNotCache*/y.V.LogLevels=y.V.NoneLogLevel;for(var r=function(e){
/*ThouShaltNotCache*/y.V.LogLevels=y.V.NoneLogLevel;for(var r=new gS,i=function(e){
/*ThouShaltNotCache*/
var t=new Hi.Z(e);t.useConstantAnimationDeltaTime=!0;var n=new mc("camera1",new Dx.Pq(0,5,-10),t);n.setTarget(Dx.Pq.Zero());new h_("light1",new Dx.Pq(0,1,0),t);var r=sg.CreateSphere("sphere1",{segments:16,diameter:2,sideOrientation:Kn.FRONTSIDE},t);r.position.y=1;sg.CreateGround("ground1",{width:6,height:6,subdivisions:2,updatable:!1},t);return t}(new gS),i=0;i<t;i++)r.render();return{classNames:n,cameraRotationLength:r.cameras[0].rotation.length()}}function lQe(e,t,n){
var t=new Hi.Z(e);t.useConstantAnimationDeltaTime=!0;var n=new mc("camera1",new Dx.Pq(0,5,-10),t);n.setTarget(Dx.Pq.Zero());new h_("light1",new Dx.Pq(0,1,0),t);var r=sg.CreateSphere("sphere1",{segments:16,diameter:2,sideOrientation:Kn.FRONTSIDE},t);r.position.y=1;sg.CreateGround("ground1",{width:6,height:6,subdivisions:2,updatable:!1},t);return t}(r),o=0;o<t;o++)i.render();return{classNames:n,cameraRotationLength:i.cameras[0].rotation.length(),disposer:function(){
/*ThouShaltNotCache*/
/*ThouShaltNotCache*/
pQe(i,r)}}}function lQe(e,t,n){
/*ThouShaltNotCache*/
return fQe.apply(this,arguments)}function fQe(){
/*ThouShaltNotCache*/
Expand All @@ -50499,7 +50502,11 @@ for(;;)switch(t.n){case 0:
/*ThouShaltNotCache*/
return o=l.length>3&&void 0!==l[3]?l[3]:10,
/*ThouShaltNotCache*/
a=Object.keys(e),y.V.LogLevels=y.V.NoneLogLevel,s=new gS({deterministicLockstep:!0}),t.n=1,hQe(s,n,r,i);case 1:for(u=t.v,c=0;c<o;c++)u.animate(),u.render();return t.a(2,{classNames:a,cameraRotationLength:u.cameras[0].rotation.length()})}},t)})),fQe.apply(this,arguments)}function hQe(e,t,n,r){
a=Object.keys(e),y.V.LogLevels=y.V.NoneLogLevel,s=new gS({deterministicLockstep:!0}),t.n=1,hQe(s,n,r,i);case 1:for(u=t.v,c=0;c<o;c++)u.animate(),u.render();return t.a(2,{classNames:a,cameraRotationLength:u.cameras[0].rotation.length(),disposer:function(){
/*ThouShaltNotCache*/
/*ThouShaltNotCache*/
/*ThouShaltNotCache*/
pQe(u,s)}})}},t)})),fQe.apply(this,arguments)}function hQe(e,t,n,r){
/*ThouShaltNotCache*/
return dQe.apply(this,arguments)}function dQe(){
/*ThouShaltNotCache*/
Expand All @@ -50510,5 +50517,7 @@ var o,a,s,u,c,l,f,h,d,p,_,m,v,g,y,b,S,A,x,T,P;return oQe().w(function(e){
for(;;)switch(e.n){case 0:
/*ThouShaltNotCache*/
/*ThouShaltNotCache*/
return(o=new Hi.Z(t)).useConstantAnimationDeltaTime=!0,o.clearColor=new Dx.v9(.31,.48,.64),new Oc("camera",ve.S0.ToRadians(125),ve.S0.ToRadians(70),25,new Dx.Pq(0,3,0),o).lowerRadiusLimit=10,e.n=1,iQe();case 1:return a=e.v,o.enablePhysics(new Dx.Pq(0,-9.8,0),new qQ(!0,a)),s={},u={},c=sg.CreateSphere("cannonBall",{diameter:.3},o),(l=new Xh("cannonBallMaterial",o)).diffuseColor=Dx.v9.Black(),l.specularPower=256,c.material=l,c.visibility=!1,(f=sg.CreateBox("killBox",{width:400,depth:400,height:4},o)).position=new Dx.Pq(0,-50,0),f.visibility=0,e.n=2,mj(n,o,{pluginExtension:".glb"});case 2:return e.v.meshes[0].name="pirateFort",o.getMeshByName("sea").material.needDepthPrePass=!0,o.getLightByName("Sun").intensity=12,e.n=3,mj(r,o,{pluginExtension:".glb"});case 3:for(h=e.v,(d=h.meshes[0].getChildren()[0]).setParent(null),h.meshes[0].dispose(),p=d.getChildMeshes(),_=0;_<p.length;_++)p[_].metadata="cannon";for(m=h.animationGroups,v=[],g=0;g<m.length;g++)m[g].stop(),v.push(m[g].targetedAnimations[0].animation),m[g].dispose();for((y=new oe.AnimationGroup("cannonAnimGroup")).addTargetedAnimation(v[0],d.getChildMeshes()[1]),y.addTargetedAnimation(v[1],d.getChildMeshes()[0]),(b=sg.CreateBox("particleEmitter",{size:.05},o)).position=new Dx.Pq(0,.76,1.05),b.rotation.x=ve.S0.ToRadians(78.5),b.isVisible=!1,b.setParent(d.getChildMeshes()[1]),(S=tbe.Parse(i,o,"")).emitter=b,S.targetStopDuration=.2,A=[[new Dx.Pq(.97,5.52,1.79),new Dx.Pq(ve.S0.ToRadians(0),ve.S0.ToRadians(0),ve.S0.ToRadians(180))],[new Dx.Pq(1.08,2.32,3.05),new Dx.Pq(ve.S0.ToRadians(0),ve.S0.ToRadians(0),ve.S0.ToRadians(180))],[new Dx.Pq(1.46,2.35,-.73),new Dx.Pq(ve.S0.ToRadians(0),ve.S0.ToRadians(90),ve.S0.ToRadians(180))],[new Dx.Pq(1.45,5.52,-1.66),new Dx.Pq(ve.S0.ToRadians(0),ve.S0.ToRadians(90),ve.S0.ToRadians(180))],[new Dx.Pq(1.49,8.69,-.35),new Dx.Pq(ve.S0.ToRadians(0),ve.S0.ToRadians(90),ve.S0.ToRadians(180))],[new Dx.Pq(-1.37,8.69,-.39),new Dx.Pq(ve.S0.ToRadians(0),ve.S0.ToRadians(-90),ve.S0.ToRadians(180))],[new Dx.Pq(.58,4,-2.18),new Dx.Pq(ve.S0.ToRadians(0),ve.S0.ToRadians(180),ve.S0.ToRadians(180))],[new Dx.Pq(1.22,8.69,-2.5),new Dx.Pq(ve.S0.ToRadians(0),ve.S0.ToRadians(180),ve.S0.ToRadians(180))],[new Dx.Pq(-1.31,2.33,-2.45),new Dx.Pq(ve.S0.ToRadians(0),ve.S0.ToRadians(180),ve.S0.ToRadians(180))],[new Dx.Pq(-3.54,5.26,-2.12),new Dx.Pq(ve.S0.ToRadians(0),ve.S0.ToRadians(-90),ve.S0.ToRadians(180))]],x=0;x<10;x++)(T=d.clone("cannonClone"+x)).position=A[x][0],T.rotation=A[x][1],(P=new oe.AnimationGroup("cannonAnimGroupClone"+x)).addTargetedAnimation(y.targetedAnimations[0].animation,T.getChildMeshes()[1]),P.addTargetedAnimation(y.targetedAnimations[1].animation,T.getChildMeshes()[0]),s[T.name]=P.name,u[T.name]=1;return d.dispose(),y.dispose(),S.dispose(),e.a(2,o)}},e)}))).apply(this,arguments)}}(),BabylonJSBenchmark=r}();
return(o=new Hi.Z(t)).useConstantAnimationDeltaTime=!0,o.clearColor=new Dx.v9(.31,.48,.64),new Oc("camera",ve.S0.ToRadians(125),ve.S0.ToRadians(70),25,new Dx.Pq(0,3,0),o).lowerRadiusLimit=10,e.n=1,iQe();case 1:return a=e.v,o.enablePhysics(new Dx.Pq(0,-9.8,0),new qQ(!0,a)),s={},u={},c=sg.CreateSphere("cannonBall",{diameter:.3},o),(l=new Xh("cannonBallMaterial",o)).diffuseColor=Dx.v9.Black(),l.specularPower=256,c.material=l,c.visibility=!1,(f=sg.CreateBox("killBox",{width:400,depth:400,height:4},o)).position=new Dx.Pq(0,-50,0),f.visibility=0,e.n=2,mj(n,o,{pluginExtension:".glb"});case 2:return e.v.meshes[0].name="pirateFort",o.getMeshByName("sea").material.needDepthPrePass=!0,o.getLightByName("Sun").intensity=12,e.n=3,mj(r,o,{pluginExtension:".glb"});case 3:for(h=e.v,(d=h.meshes[0].getChildren()[0]).setParent(null),h.meshes[0].dispose(),p=d.getChildMeshes(),_=0;_<p.length;_++)p[_].metadata="cannon";for(m=h.animationGroups,v=[],g=0;g<m.length;g++)m[g].stop(),v.push(m[g].targetedAnimations[0].animation),m[g].dispose();for((y=new oe.AnimationGroup("cannonAnimGroup")).addTargetedAnimation(v[0],d.getChildMeshes()[1]),y.addTargetedAnimation(v[1],d.getChildMeshes()[0]),(b=sg.CreateBox("particleEmitter",{size:.05},o)).position=new Dx.Pq(0,.76,1.05),b.rotation.x=ve.S0.ToRadians(78.5),b.isVisible=!1,b.setParent(d.getChildMeshes()[1]),(S=tbe.Parse(i,o,"")).emitter=b,S.targetStopDuration=.2,A=[[new Dx.Pq(.97,5.52,1.79),new Dx.Pq(ve.S0.ToRadians(0),ve.S0.ToRadians(0),ve.S0.ToRadians(180))],[new Dx.Pq(1.08,2.32,3.05),new Dx.Pq(ve.S0.ToRadians(0),ve.S0.ToRadians(0),ve.S0.ToRadians(180))],[new Dx.Pq(1.46,2.35,-.73),new Dx.Pq(ve.S0.ToRadians(0),ve.S0.ToRadians(90),ve.S0.ToRadians(180))],[new Dx.Pq(1.45,5.52,-1.66),new Dx.Pq(ve.S0.ToRadians(0),ve.S0.ToRadians(90),ve.S0.ToRadians(180))],[new Dx.Pq(1.49,8.69,-.35),new Dx.Pq(ve.S0.ToRadians(0),ve.S0.ToRadians(90),ve.S0.ToRadians(180))],[new Dx.Pq(-1.37,8.69,-.39),new Dx.Pq(ve.S0.ToRadians(0),ve.S0.ToRadians(-90),ve.S0.ToRadians(180))],[new Dx.Pq(.58,4,-2.18),new Dx.Pq(ve.S0.ToRadians(0),ve.S0.ToRadians(180),ve.S0.ToRadians(180))],[new Dx.Pq(1.22,8.69,-2.5),new Dx.Pq(ve.S0.ToRadians(0),ve.S0.ToRadians(180),ve.S0.ToRadians(180))],[new Dx.Pq(-1.31,2.33,-2.45),new Dx.Pq(ve.S0.ToRadians(0),ve.S0.ToRadians(180),ve.S0.ToRadians(180))],[new Dx.Pq(-3.54,5.26,-2.12),new Dx.Pq(ve.S0.ToRadians(0),ve.S0.ToRadians(-90),ve.S0.ToRadians(180))]],x=0;x<10;x++)(T=d.clone("cannonClone"+x)).position=A[x][0],T.rotation=A[x][1],(P=new oe.AnimationGroup("cannonAnimGroupClone"+x)).addTargetedAnimation(y.targetedAnimations[0].animation,T.getChildMeshes()[1]),P.addTargetedAnimation(y.targetedAnimations[1].animation,T.getChildMeshes()[0]),s[T.name]=P.name,u[T.name]=1;return d.dispose(),y.dispose(),S.dispose(),e.a(2,o)}},e)}))).apply(this,arguments)}function pQe(e,t){
/*ThouShaltNotCache*/
e.disablePhysicsEngine(),t.stopRenderLoop(),e.dispose(),t.dispose()}}(),BabylonJSBenchmark=r}();
//# sourceMappingURL=bundle.es5.min.js.map
2 changes: 1 addition & 1 deletion babylonjs/dist/bundle.es5.min.js.map

Large diffs are not rendered by default.

Loading
Loading