September 30, 2021

On Thursday, 30 September 2021 at 02:31:50 UTC, Hipreme wrote:

>

https://github.com/MrcSnm/HipremeEngine/tree/hotload/api

You may try messing at the module api.graphics.g2d.renderer2d

There is a function called initG2D

Try changing it from loadSymbols to each one loadSymbol.

You can just dub at the folder api.

The version I checked out, 2874073b54, doesn't have a loadSymbols.

As provided, loadSymbol without the "static if":

965K libhipengine_api.a

with mixin(loadSymbol("name")) instead of a template:

749K libhipengine_api.a

https://gist.github.com/jrfondren/d776ccffb105f464b53c53712656a1d3

That's probably disappointing, since it's a much less pleasant interface, but what you could do is take the both entire extern(C) void function() beginSprite; ... loadSymbol!beginSprite; blocks and put them in one string literal that you process with a function and mixin once. Now instead of an annoying macro alternative you have a DSL for DLL-extern functions.

September 30, 2021

On Thursday, 30 September 2021 at 03:13:28 UTC, jfondren wrote:

>

As provided, loadSymbol without the "static if":

965K libhipengine_api.a

with mixin(loadSymbol("name")) instead of a template:

749K libhipengine_api.a

The difference goes down to 66K vs. 60K with dub -brelease --compiler=gdc. ldc's not as slim but still much better than dmd, and -brelease is actually much less significant. So dmd's the main culprit for the bloat here. huh.

But since you have importPaths-ldc perhaps you weren't using dmd to begin with.

September 30, 2021

On Thursday, 30 September 2021 at 03:21:51 UTC, jfondren wrote:

>

On Thursday, 30 September 2021 at 03:13:28 UTC, jfondren wrote:

>

As provided, loadSymbol without the "static if":

965K libhipengine_api.a

with mixin(loadSymbol("name")) instead of a template:

749K libhipengine_api.a

The difference goes down to 66K vs. 60K with dub -brelease --compiler=gdc. ldc's not as slim but still much better than dmd, and -brelease is actually much less significant. So dmd's the main culprit for the bloat here. huh.

But since you have importPaths-ldc perhaps you weren't using dmd to begin with.

Yup. The mixin(loadSymbol("")) seems the best way to do.

I believe that should be the option for loading separated symbols while loadSymbols version is the best for loading a lot of symbols(IDK how expensive is mixing a lot of functions) as it costs 1KB per instantiation.

I'm actually using DMD and LDC, dmd compiles a bit faster, but I use ldc for deploying it. Never used GDC.

1 2
Next ›   Last »