Skip to content

Comments

perf(traverse): store Ancestor parts as SoA#5284

Closed
overlookmotel wants to merge 1 commit intomainfrom
08-27-perf_traverse_store_ancestor_parts_as_soa
Closed

perf(traverse): store Ancestor parts as SoA#5284
overlookmotel wants to merge 1 commit intomainfrom
08-27-perf_traverse_store_ancestor_parts_as_soa

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Aug 28, 2024

WIP. This is more of an experiment than anything else, to see what effect it has storing the discriminant and payload of an enum separately, in order to reduce memory usage. Each Ancestor is stored in 10 bytes, instead of 16.

@graphite-app
Copy link
Contributor

graphite-app bot commented Aug 28, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

Copy link
Member Author

overlookmotel commented Aug 28, 2024

@codspeed-hq
Copy link

codspeed-hq bot commented Aug 28, 2024

CodSpeed Performance Report

Merging #5284 will not alter performance

Comparing 08-27-perf_traverse_store_ancestor_parts_as_soa (835256c) with main (91b39c4)

Summary

✅ 29 untouched benchmarks

@overlookmotel
Copy link
Member Author

A 1% perf bump. Perhaps not worth it for the amount of unsafe code. But probably would have more effect for a larger Vec of enums like Vec<AstKind>.

@Dunqing
Copy link
Member

Dunqing commented Aug 28, 2024

A 1% perf bump. Perhaps not worth it for the amount of unsafe code. But probably would have more effect for a larger Vec of enums like Vec<AstKind>.

Currently, only benchmark typescript plugin, if benchmark all the plugins, may have more perf bump

@overlookmotel overlookmotel force-pushed the 08-27-perf_traverse_store_ancestor_parts_as_soa branch from 6e1d8d5 to 45f400a Compare August 28, 2024 12:30
@overlookmotel overlookmotel changed the base branch from main to 08-28-refactor_traverse_traversectx_ancestors_do_not_return_ancestor_none_ August 28, 2024 12:30
@overlookmotel overlookmotel force-pushed the 08-28-refactor_traverse_traversectx_ancestors_do_not_return_ancestor_none_ branch from 870fab0 to bfdf5ed Compare August 28, 2024 12:38
@overlookmotel overlookmotel force-pushed the 08-27-perf_traverse_store_ancestor_parts_as_soa branch from 45f400a to 5413584 Compare August 28, 2024 12:39
@overlookmotel overlookmotel force-pushed the 08-28-refactor_traverse_traversectx_ancestors_do_not_return_ancestor_none_ branch from bfdf5ed to 7432d25 Compare August 28, 2024 13:06
@overlookmotel overlookmotel force-pushed the 08-27-perf_traverse_store_ancestor_parts_as_soa branch from 5413584 to 9d6e661 Compare August 28, 2024 13:06
@overlookmotel overlookmotel force-pushed the 08-28-refactor_traverse_traversectx_ancestors_do_not_return_ancestor_none_ branch from 7432d25 to cdbc60d Compare August 28, 2024 14:14
@overlookmotel overlookmotel force-pushed the 08-27-perf_traverse_store_ancestor_parts_as_soa branch from 9d6e661 to 1084fa8 Compare August 28, 2024 14:15
@overlookmotel overlookmotel force-pushed the 08-28-refactor_traverse_traversectx_ancestors_do_not_return_ancestor_none_ branch 2 times, most recently from 0cf76d5 to 8ecbb8f Compare August 29, 2024 08:57
@overlookmotel overlookmotel force-pushed the 08-27-perf_traverse_store_ancestor_parts_as_soa branch from 1084fa8 to dbcedc7 Compare August 29, 2024 08:57
@Boshen Boshen changed the base branch from 08-28-refactor_traverse_traversectx_ancestors_do_not_return_ancestor_none_ to graphite-base/5284 August 29, 2024 09:22
@Boshen Boshen force-pushed the 08-27-perf_traverse_store_ancestor_parts_as_soa branch from dbcedc7 to a58d787 Compare August 29, 2024 09:27
@Boshen Boshen force-pushed the graphite-base/5284 branch from 8ecbb8f to da8aa18 Compare August 29, 2024 09:27
@Boshen Boshen changed the base branch from graphite-base/5284 to main August 29, 2024 09:28
@Boshen Boshen force-pushed the 08-27-perf_traverse_store_ancestor_parts_as_soa branch from a58d787 to 6542e42 Compare August 29, 2024 09:28
@overlookmotel overlookmotel force-pushed the 08-27-perf_traverse_store_ancestor_parts_as_soa branch from 6542e42 to 835256c Compare September 5, 2024 09:24
@overlookmotel
Copy link
Member Author

overlookmotel commented Sep 12, 2024

If we were going to do this, we'd better off implementing an SoA mechanism which we use everywhere (e.g. Semantic's SoA structures). So closing this and may come back to it in future.

@Boshen Boshen deleted the 08-27-perf_traverse_store_ancestor_parts_as_soa branch October 14, 2024 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants