-
-
Notifications
You must be signed in to change notification settings - Fork 693
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
make case tables immutable #1636
Conversation
- Avoids redundant object copies and semantic analysis for every usage. - Multilib archives or gc-sections will take care of the binary size issue.
LGTM, I'll adjust the generator accordingly. |
I see, where is the generator? |
- This is mainly for consistency with other tables.
- Store the static immutable CodepointTries in separate functions.
- The semantic analysis and object generation only needs to be done once when building phobos. Using those overloads becomes a simple link dependency. - add overloads for most common cases
I found a few more ways to optimize compile time and object sizes. |
If making a .di file turns out to be too hard we might be able to only import |
ATM here: I plan to one day move it to DLang tools repo. |
Another thought is probably split it up (e.g. 3 pieces - tries, sets and case entries) and use local imports in specific functions. |
Last thing that worries me is inlining or more preciesly the lack of it, see also: |
There's nothing hard about writing a .di file. It's just a list of declarations. |
But it doesn't help matters as it kills CTFE-ablity of std.uni (and consequently all of string/formatting code in Phobos). |
The function overload trick already heavily reduces compile time and template bloat for common use cases. |
make case tables immutable
make case tables immutable
Merging this did NOT decrease "hello world" size, it INCREASED it by 100Kb ! (On Windows 32) |
Ouch, I made this pull request to address the compile time issue and found some ways to deduplicate tables in different template instantiations. The hello world size was not what I optimized for. |
Sure, but extending multilib to data is not going to happen for 2.064. We need a fix for 2.064. |
Wrapping the data in |
Here is the pull that will make use of multilib #1647, trims hello world by ~300kB. |
analysis for every usage.
of the binary size issue.