Skip to content

Conversation

@ncave
Copy link
Collaborator

@ncave ncave commented Sep 9, 2020

  • Removed base class reference for most types that don't inherit from other types.
  • This is done mostly to try to improve object creation performance of classes by reducing inheritance.
  • The resulting performance is an improvement over the current state, although not as big as hoped.
  • Unfortunately still slower than using factory functions for object construction instead of classes.
  • In rough approximation and limited testing, 10-15% performance gain over the current (next) branch.
  • Still a mystery why classes perform so much slower than factory functions, could be something else.

@alfonsogarciacaro
Copy link
Member

Great work @ncave, thanks a lot! This is intriguing 🤔 It wouldn't be good if we decreases the performance of the REPL and other apps compiled by Fable. What do you think we should do? Go back to the compiler flag? Or try to investigate more to see if you can find the bottleneck and fix while still outputting classes?

@ncave
Copy link
Collaborator Author

ncave commented Sep 10, 2020

@alfonsogarciacaro One obvious thing I haven't tried yet is down-transpile to ES5 to see if that helps the performance. The only other perf-related idea that comes to mind is to get rid of all getters in classes, as we do know for sure they're slower than regular methods, for whatever reason. But that's not the main culprit in this case. Depends on the timeline of the release, if we have time we can investigate, if not we can go back to the switch.

@ncave
Copy link
Collaborator Author

ncave commented Sep 11, 2020

Rebased from #2156.

@alfonsogarciacaro alfonsogarciacaro merged commit 25c434f into fable-compiler:nagareyama Sep 12, 2020
@ncave ncave deleted the next1 branch September 12, 2020 00:07
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