Commit f32a6da
committed
feat: Cleanup to shrink smallest program size
This is a rather small pr, I was looking through the binary of our smallest program and noticed a few things that were being left behind.
Not very important but we can save a few bytes by removing the unnecessary function wrapping our exception setup, this function was required when exception handling was unsafe however it's now completely safe so there is no reason to map it.
The bigger change is I noticed that `bigIntToString` was doing some weird things, firstly the `_SIZES` array wasn't actually ever being used however it was causing the function to require a closure which was being setup in every program and adding a rather substantial amount of size. Secondly because we had a helper function that used`_DIGITS` inside of the toString method this created a closure and because we were not lazily initializing digits this was adding quite a few bytes to the program, with a few simple changes this cuts program size and I tracked length along with the result buffer when stringifying which saves an iteration over the result buffer, and the corresponding helper.1 parent 7354757 commit f32a6da
3 files changed
Lines changed: 44 additions & 94 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
485 | 485 | | |
486 | 486 | | |
487 | 487 | | |
488 | | - | |
| 488 | + | |
489 | 489 | | |
490 | 490 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
247 | 239 | | |
248 | | - | |
| 240 | + | |
249 | 241 | | |
250 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
691 | 691 | | |
692 | 692 | | |
693 | 693 | | |
694 | | - | |
695 | | - | |
696 | | - | |
697 | | - | |
698 | | - | |
699 | | - | |
700 | | - | |
701 | | - | |
702 | | - | |
703 | | - | |
704 | | - | |
705 | | - | |
706 | | - | |
707 | | - | |
708 | | - | |
709 | | - | |
710 | | - | |
711 | | - | |
712 | | - | |
713 | | - | |
714 | | - | |
715 | | - | |
716 | | - | |
717 | | - | |
718 | | - | |
719 | | - | |
720 | | - | |
721 | | - | |
722 | | - | |
723 | | - | |
724 | | - | |
725 | | - | |
726 | | - | |
727 | | - | |
728 | | - | |
729 | | - | |
730 | | - | |
731 | | - | |
732 | | - | |
733 | | - | |
734 | | - | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
735 | 704 | | |
736 | 705 | | |
737 | 706 | | |
738 | 707 | | |
739 | | - | |
740 | | - | |
741 | 708 | | |
742 | 709 | | |
743 | 710 | | |
744 | 711 | | |
745 | 712 | | |
746 | 713 | | |
747 | 714 | | |
748 | | - | |
749 | 715 | | |
750 | 716 | | |
| 717 | + | |
751 | 718 | | |
752 | 719 | | |
753 | 720 | | |
754 | 721 | | |
755 | 722 | | |
756 | | - | |
757 | | - | |
758 | 723 | | |
759 | 724 | | |
760 | 725 | | |
| |||
763 | 728 | | |
764 | 729 | | |
765 | 730 | | |
766 | | - | |
767 | | - | |
768 | | - | |
769 | | - | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
770 | 734 | | |
771 | 735 | | |
772 | 736 | | |
| |||
775 | 739 | | |
776 | 740 | | |
777 | 741 | | |
778 | | - | |
| 742 | + | |
| 743 | + | |
779 | 744 | | |
780 | 745 | | |
781 | 746 | | |
782 | 747 | | |
783 | 748 | | |
784 | | - | |
785 | 749 | | |
786 | 750 | | |
787 | 751 | | |
| |||
801 | 765 | | |
802 | 766 | | |
803 | 767 | | |
804 | | - | |
805 | | - | |
806 | | - | |
807 | | - | |
| 768 | + | |
| 769 | + | |
808 | 770 | | |
809 | 771 | | |
810 | | - | |
811 | | - | |
812 | | - | |
813 | | - | |
| 772 | + | |
814 | 773 | | |
815 | | - | |
816 | | - | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
817 | 780 | | |
818 | 781 | | |
819 | 782 | | |
820 | 783 | | |
| 784 | + | |
821 | 785 | | |
822 | | - | |
823 | | - | |
824 | | - | |
825 | | - | |
826 | | - | |
827 | | - | |
828 | | - | |
829 | | - | |
830 | 786 | | |
831 | 787 | | |
832 | | - | |
833 | | - | |
834 | | - | |
835 | | - | |
| 788 | + | |
| 789 | + | |
836 | 790 | | |
837 | | - | |
838 | | - | |
| 791 | + | |
| 792 | + | |
839 | 793 | | |
| 794 | + | |
840 | 795 | | |
841 | 796 | | |
842 | | - | |
843 | 797 | | |
844 | 798 | | |
845 | 799 | | |
| |||
0 commit comments