-
Notifications
You must be signed in to change notification settings - Fork 8
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
String Literal Struct Accessor to Hash Optimization #2821
Comments
Fixed in 2024.2 - optimisations have been added
NOTE: My test code for this is
|
@rwkay if it's optimised this way, then it would break existing functionality as Or, alternatively, it's time for |
..or |
OK this is now fixed for the case where
|
Does that mean we can now use hash literals? like for instance if I want to pass |
No it is just a notation I was using to describe what is happening it is not GML syntax |
YoYoGames/GameMaker-Bugs#2804 YoYoGames/GameMaker-Bugs#2821 * Added a note under "Struct Functions" on the Variable Functions page
* develop: [Feature] Review for PR #88 [General] Fixed toc when-closed arrow icon, needed rotation [General] Added file for ToC when-closed arrow [General] added css appends for index and glossary colours [Feature] Sequence Audio FX Parameters review [General]variable_clone() doesn't copy script refs in arrays correctly YoYoGames/GameMaker-Bugs#4548 * Added an additional note to mention you cannot clone built-in structs [Feature]Audio FX Parameter Tracks YoYoGames/GameMaker-Bugs#3162 * Added a new page "Sound in Sequences" under "The Sequence Editor": * Overview image, ways in which to add sounds, details on emitters, audio effects and the Inspector * Reordering audio effects in the Track Panel * Short section on audio emitters' positions in sequence instances (i.e. the sequence instance's transform is added to the emitter's position) * Added GIFs & videos to make things clearer * "The Track Panel" page: * Listed audio effects under "Adding Parameter Tracks" * "The Sequence Instance Struct" page: * Added soundIndex property under activeTracks, which refers to the sound *instance* currently being played * "The Track Struct" page: * Listed all audio effect track parameter names under "Name" * Replaced all occurrences of maximum number of effect slots value of 8 with a RH variable * Some typo fixes here and there, replaced hyperlinks with cross-references, names with variables, etc. [General]Add note to for page that explains multiple variable assignment using var [Feature]Add vertex_submit_ext which takes a known amount of Vertexes YoYoGames/GameMaker-Bugs#2754 * Provided some details on frozen vertex buffers (reside in VRAM) * Consistency between vertex_submit & vertex_submit_ext function pages * Moved "surface must exist" warning note to snippet and inserted that on the function pages * Added a full description for the second example on the vertex_submit_ext page, fixed the modulo calculation so the max number will include the final vertex All done [Feature]Vertex Buffer Update Functions YoYoGames/GameMaker-Bugs#3163 * Added function page using script & added to ToC, updated links * Added most page contents, examples still to review [Feature]Debugger: [Mac IDE] Unable to use F11 to 'Step into function call' as it is overridden by the system hotkey default YoYoGames/GameMaker-Bugs#2337 * Manually added to the Shortcuts page, it will be added automatically with the next export from the shortcuts [General]In-Game: get_string_async() causes games to come out of fullscreen, minimised and paused YoYoGames/GameMaker-Bugs#2255 * Added a note to the Dialog page, explaining that you can use borderless fullscreen if you want to use these functions * Moved notes on the async function pages to a snippet and inserted that * Some other visual changes on the pages [Feature]Included Files Refresh Button YoYoGames/GameMaker-Bugs#2729 * Updated screenshots on page, added an icon image for the Refresh button * Added a line about the button [Feature]Textures that are resized to fit a texture page size end up on a texture page of a smaller size YoYoGames/GameMaker-Bugs#4386 * Updated screenshot & removed list items for actual width & height on The Debug Overlay page [Feature]String Literal Hash Optimization YoYoGames/GameMaker-Bugs#2804 YoYoGames/GameMaker-Bugs#2821 * Added a note under "Struct Functions" on the Variable Functions page [General]Manual+In-Game: Feather/Manual info for audio_destroy_stream() is incorrect, and the function does not return its intended value correctly YoYoGames/GameMaker-Bugs#4415 * Changed the parameter: renamed to "sound", type changed to Sound Asset, return value to Real (int32 isn't a type we've documented so far in the manual) * Tiny other changes to the page
Is your feature request related to a problem?
Would be nice if string literals would be converted into hash look ups when using
struct_get
,struct_exists
, or the[$ ""]
operator at compile time.evidence of this not happening:


YYC:
VM:
Describe the solution you'd like
when a string literal is given to a struct accessor it should be converted into a hash look up with a real literal at compile time.
Describe alternatives you've considered
adding a build script to my projects to optimize.
Using forceinline functions with statics which will cache the hash the first time then always returns that. But this does not actually work.
Additional context
No response
The text was updated successfully, but these errors were encountered: