Skip to content
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

Enable whole-program optimization when compiling eSpeak-NG #17623

Closed
gexgd0419 opened this issue Jan 15, 2025 · 1 comment · Fixed by #17631
Closed

Enable whole-program optimization when compiling eSpeak-NG #17623

gexgd0419 opened this issue Jan 15, 2025 · 1 comment · Fixed by #17631
Labels
component/speech p5 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation.
Milestone

Comments

@gexgd0419
Copy link
Contributor

Is your feature request related to a problem? Please describe.

As for now, whole-program optimization for eSpeak-NG is intentionally turned off.

# Whole-program optimization causes eSpeak to distort and warble with its Klatt4 voice
# Therefore specifically force it off
"/GL-",

I tried the klatt4 variant, but couldn't notice the difference between enabling and disabling the whole-program optimization. In fact, the waveforms generated are exactly the same.

If enabling whole-program optimization produces a different result, it should be a bug in the compiler/linker.

Maybe newer versions of eSpeak or newer versions of the MSVC compiler have fixed the bug. Or maybe I tested in a wrong way.

Describe the solution you'd like

Enable whole-program optimization by removing the /GL- option.

This can make the eSpeak DLL more efficient and smaller, from 637 KiB to 624 KiB.

It can also solve the problem of using a dynamically linked version of Sonic without __declspec(dllimport) in the header, because the optimization will be performed by the linker, if whole-program optimization is enabled.

Describe alternatives you've considered

Additional context

@gexgd0419
Copy link
Contributor Author

@michaelDCurran I found that this was introduced in commit cf0443b when MSVC 2012 was used to compile eSpeak. Could you check whether the issue still exists in the current compiler version?

@gerald-hartig gerald-hartig added p5 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation. component/speech labels Jan 20, 2025
seanbudd pushed a commit that referenced this issue Jan 21, 2025
Closes #17623

Summary of the issue:
As for now, whole-program optimization for eSpeak-NG is intentionally turned off.

# Whole-program optimization causes eSpeak to distort and warble with its Klatt4 voice
# Therefore specifically force it off
"/GL-",
This was introduced in commit cf0443b when MSVC 2012 was used to compile eSpeak.

Enabling whole-program optimization can make the eSpeak DLL more efficient and smaller, from 637 KiB to 624 KiB.

It can also solve the problem of using a dynamically linked version of Sonic without __declspec(dllimport) in the header, because the optimization will be performed by the linker, if whole-program optimization is enabled.
@github-actions github-actions bot added this to the 2025.1 milestone Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/speech p5 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants