Notepad2e icon indicating copy to clipboard operation
Notepad2e copied to clipboard

Optimize for size

Open csware opened this issue 7 years ago • 7 comments

This improves issue #183. However, I suppose you/we want to discuss comit 30ddf5c as this introduces a new dependency to the VS2017 C++ Runtime Libraries (which are not present on all Windows systems by default, IIRC).

This MR is supposed to be on top of #184.

csware avatar Aug 15 '18 07:08 csware

Personally I would choose speed over size. I believe most other users too. I don't think optimizing for speed over size alone is what is making our builds so much larger (#183).

Default configuration should be optimizing for speed.

ProgerXP avatar Aug 15 '18 21:08 ProgerXP

Is it normal that GitHub shows diff in this PR with already merged master as if it wasn't merged? Supposedly it should only show new changes in this PR compared to new HEAD.

ProgerXP avatar Aug 20 '18 20:08 ProgerXP

  1. Optimization for size allow to decrease binary size for ~300KiB. You've already decided not to use this option by default.
  2. Switching to "Multi-threaded DLL" runtime library (/MD option) allow to decrease binary size for ~200 KiB but caused a dependency from the external runtime DLLs. Unfortunately, this option heavily defeats the portability of the Notepad2e builds and does not allow to start application on clean OSes (even on Windows 10), error prompt will popup: image
  3. Summary: total available size decrease is ~500KiB.
Size, KiB /MT /MT + optimization /MD /MD + optimization
Release x86 2017 1821 1705 1503
Release x64 2420 2145 2188 1915
  1. At this point diff for this PR vs master branch is shown correctly.

Please clarify: what is supposed to be done with the changes from this PR?

cshnik avatar Aug 28 '18 17:08 cshnik

@csware What are we supposed to do with this PR?

ProgerXP avatar Sep 01 '18 17:09 ProgerXP

Yesterday I build the vanilla Notepad2 sources (with VS2017) and got a binary of ~800kib, building bf22e43296723fae63e6651508800cb81b676abc alrteady resulted in ~1,2mib (x86).

csware avatar Feb 21 '19 11:02 csware

Yesterday I build the vanilla Notepad2 sources (with VS2017) and got a binary of ~800kib, building bf22e43 alrteady resulted in ~1,2mib (x86).

Could you figure why? Maybe because of the updated Scintilla? Or VC runtime version?

Personally I don't mind the extra 1.5 MiB of size Notepad 2e brings. It's almost completely irrelevant in today's world, it's not like we're talking about 10s or 100s of megabytes gained.

If there's an easy way to shed off some size without sacrificing functionality (Boost, etc.) or speed, then it's fine, but if not, I would not stress too much over it.

ProgerXP avatar Feb 21 '19 20:02 ProgerXP

building bf22e43 alrteady resulted in ~1,2mib (x86).

I wonder if it's a coincidence that XhmikosR's mod (https://github.com/XhmikosR/notepad2-mod/) is about the same size, 1.38 MB.

ProgerXP avatar Feb 21 '19 21:02 ProgerXP