-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CC3 Engine Code double size from CC2 #10354
Comments
@Ronsku yep, we are still trying do more effort on it. Can i know where will you publish your games? |
Thanks @minggo, great to hear! |
Thanks @Ronsku , i will ask your help if needed. |
@minggo, No limitations really, just like any website or software you want it to be loading as fast as possible to your users. Doubling the size of the engine causes bigger loading times and a worse user-experience. Earnings comes from user satisfaction and from the same logic as loading a webpage. If the webpage you are going to is loading for too long you might leave it and the company would lose a potential customer. I think loading times are always very important for a good UX. You want to play, not watch a loading screen. |
@Ronsku thanks for the information. How long it takes based on your testing? And what's the loading time is acceptable? |
That's a very difficult question to answer, since it is all based on server and user connection and also user's device that needs to run the code, launch the Web Canvas etc. Problem in this case is that the CC3 final built code with most features cropped out is still double the side of the final build of a CC2 game. Thank you @pandamicro for picking this up. Highly appreciated! |
@pandamicro and @minggo I'm not sure what is making it so massive, but it hurts loading times a lot. |
Yes, we have identified some optimization points, such as eliminating built-in effects and optimizing the decorators, and in version 3.6, we will optimize these part |
Amazing, can't wait! I will be a very big boost to the game loading :) |
@holycanvas Does this help in native env as well? |
@holycanvas I really hope this ticket will be taken seriously, because it is actually causing a lot of problems for me currently. Having over 2x size on cc.js doesn't only cause 2x loading downloading time, but the worst part is that especially on slower devices parsing of huge JavaScript files is really costly. I have huge difference between loading CC2 and CC3 games. I was even struggling a bit in CC2 to get good loading times. Now in CC3 it just takes way too long with this massive 2.2Mb chunk of JavaScript. Can you help me understand what is the main reason behind the size? |
How about "Feature Cropping"? It doesn't seem to affect the bundle size if you check out most of the packages form the feature cropping in project settings. For example in 2D games, I'm just guessing that the whole 3D library is packaged with it, even though it is not selected in the feature cropping. |
@Ronsku Have you tried the build setting "Erase module structure(experimental)"? That option will flattern import chain. |
@shrinktofit No I had not tried that one before. I tried it now with an empty project. Here are the results: Build Settings WITHOUT "Erase module structure(experimental)" Build Settings WITH "Erase module structure(experimental)" Size of the Engine code is exactly the same 😞 |
@Ronsku Well this option is dedicated to project scripts, not engine :) |
@shrinktofit I see, but didn't help with loading speed for me at least. Engine size is the issue |
In v3.6, we will remove effects.js from the engine to achieve two goals
This is also described in #10529, so we will complete the last in v3.6, and I'm moving this issue to v3.7 so that we can keep tracking further optimizations @holycanvas How is the progression of this task ? |
@PPpro @holycanvas @pandamicro Are there any plans to bring this back? I need to be able to create 2D games that loads fast and efficiently. CC2 is already much slower and bigger than than for example PixiJS, but still in an acceptable range. While CC3 becomes so slow and heavy that it's not an option anymore :(. I and a lot of other people really wants to swap to CC3 to get all the other benefits from it, but we're unable due to this. |
@Ronsku we are improving modularization these days. Then developers can use features they want. It will be released in v3.8, which is planned to be released in June. |
Sorry, we adjusted this issue plan to milestrone 3.9 |
Okay, thanks for the update! Thanks, let me know if I can help in any way! |
麻烦一起看看3.x各个版本之后的包体增加,应该是相同的问题。 |
Thanks for posting this on the forums as well! Any attention to this will help😊. I'm just hoping that we could get the latest Cocos Creator versions bundle size and loading times to be as good or better as it was to create 2D games in CC2 many years back. I'm still forced to use 2.4.11. |
Praying for 3.9 with everything I have! 🙏 |
We will continue to optimize the engine's packages in 3.8.x. But it's really hard to fully optimize to 2.x level |
the spine asm.js module is a fallback for spine wasm module, which is another part of the added package size. |
@jareguo Thank you so much, I believe its a big challenge, but 1.9Mb engine size + features like spine is so big for smaller games, where you would like to ensure a fast loading. Compared to the size of for example pixi.js v6.4.2 is 479.1 kB (minified), and 125.6 kB when compressed using GZIP. The latest versions even slightly smaller. That makes CC2.4.8 about 2.8x bigger and CC3.8.0 5x bigger than pixi.js using GZIP.
Thanks for your message @PPpro, here are the results in CC 3.8.0: Without checked "Cull Engine Asm.js Module": With checked "Cull Engine Asm.js Module": Engine itself in both cases adding an additional whopping 1.9Mb uncompressed size. Massive for 2D use 😓. |
Just to update this issue. I ran similar tests on 3.8.1 and 3.8.2 as my above 3.8.0 output. |
The goal for 3.8.4 is to make the package size less or equal 3.8.0, and we will continue reducing package size in all versions. |
In CC3 the cc.js engine file seems to be quite a bit larger than in CC2. It's still huge after disabling all the features I don't need.
Are you looking into making it smaller or isn't it possible?
CC3 (2200 KB)
CC2 (1011 KB, Over 100% smaller!)
And this one from CC3 is with almost every feature turned off:
I'm guessing there are something from 3D that is not cleaned up in the engine, even though you create a fully 2D game? This has a big effect on total bundle size of games.
The text was updated successfully, but these errors were encountered: