presidentbeef / brat

Brat is a little language for people who don't like to be told what to do.
https://www.brat-lang.info/
93 stars 6 forks source link

[core] Only create prototype when needed #11

Closed presidentbeef closed 7 years ago

presidentbeef commented 7 years ago

Each object has a "prototype" object attached which holds "instance" methods, if they are ever defined. However, most objects never need this object.

This patch removes default creation of prototype objects and instead creates them "on demand" when needed.

This speeds up some programs and definitely reduces memory use.