OLD | NEW |
1 /* | 1 /* |
2 This file is part of LilyPond, the GNU music typesetter. | 2 This file is part of LilyPond, the GNU music typesetter. |
3 | 3 |
4 Copyright (C) 1997--2020 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 1997--2020 Han-Wen Nienhuys <hanwen@xs4all.nl> |
5 | 5 |
6 LilyPond is free software: you can redistribute it and/or modify | 6 LilyPond is free software: you can redistribute it and/or modify |
7 it under the terms of the GNU General Public License as published by | 7 it under the terms of the GNU General Public License as published by |
8 the Free Software Foundation, either version 3 of the License, or | 8 the Free Software Foundation, either version 3 of the License, or |
9 (at your option) any later version. | 9 (at your option) any later version. |
10 | 10 |
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 sane_putenv ("GUILE_MIN_YIELD_2", yield, overwrite); | 718 sane_putenv ("GUILE_MIN_YIELD_2", yield, overwrite); |
719 sane_putenv ("GUILE_MIN_YIELD_MALLOC", yield, overwrite); | 719 sane_putenv ("GUILE_MIN_YIELD_MALLOC", yield, overwrite); |
720 | 720 |
721 sane_putenv ("GUILE_INIT_SEGMENT_SIZE_1", | 721 sane_putenv ("GUILE_INIT_SEGMENT_SIZE_1", |
722 "10485760", overwrite); | 722 "10485760", overwrite); |
723 sane_putenv ("GUILE_MAX_SEGMENT_SIZE", | 723 sane_putenv ("GUILE_MAX_SEGMENT_SIZE", |
724 "104857600", overwrite); | 724 "104857600", overwrite); |
725 } | 725 } |
726 | 726 |
727 #if (GUILEV2) | 727 #if (GUILEV2) |
728 extern unsigned long GC_free_space_divisor; | |
729 | 728 |
730 void | 729 void |
731 setup_guile_v2_env () | 730 setup_guile_v2_env () |
732 /* | 731 /* |
733 * Set up environment variables relevant to compiling | 732 * Set up environment variables relevant to compiling |
734 * Scheme files for Guile V2. | 733 * Scheme files for Guile V2. |
735 */ | 734 */ |
736 { | 735 { |
737 sane_putenv ("GUILE_AUTO_COMPILE", "0", false); // disable auto-compile | 736 sane_putenv ("GUILE_AUTO_COMPILE", "0", false); // disable auto-compile |
738 sane_putenv ("GUILE_WARN_DEPRECATED", "detailed", | 737 sane_putenv ("GUILE_WARN_DEPRECATED", "detailed", |
739 "true"); // set Guile to info re deprecation | 738 "true"); // set Guile to info re deprecation |
740 /* | 739 /* |
741 Set root for Guile %compile-fallback to | 740 Set root for Guile %compile-fallback to |
742 Lilypond root for its data. | 741 Lilypond root for its data. |
743 */ | 742 */ |
744 sane_putenv ("XDG_CACHE_HOME", lilypond_datadir, true); | 743 sane_putenv ("XDG_CACHE_HOME", lilypond_datadir, true); |
745 | 744 |
746 // This reduces the GC overhead during parsing and | 745 // This reduces the GC overhead during parsing and |
747 // initialization. To see if this is a good value, run #(display | 746 // initialization. To see if this is a good value, run #(display |
748 // (gc-stats)) just before \maininput in init.ly, and check that | 747 // (gc-stats)) just before \maininput in init.ly, and check that |
749 // it's roughly this value. | 748 // it's roughly this value. |
750 sane_putenv ("GC_INITIAL_HEAP_SIZE", "40M", false); | 749 sane_putenv ("GC_INITIAL_HEAP_SIZE", "40M", false); |
751 | 750 |
| 751 /* |
| 752 Empirically, multithreaded GC doesn't change wall time. It just |
| 753 adds another thread that burns 30% of the time. |
| 754 |
| 755 David K mentions: "I think that this may be due to both/either our |
| 756 use of mark hooks and of finalisers for calling destructors. |
| 757 Either may cause serialisation. Another serialisation is because |
| 758 Guile itself switches BGC to Java mode where finalised objects can |
| 759 no longer be marked (or something like that: the exact semantics I |
| 760 do not remember). And of course the C++ free store still has to |
| 761 do its full job. |
| 762 */ |
| 763 sane_putenv ("GC_NPROCS", "1", false); |
| 764 |
752 // Use less CPU for GC, at the expense of memory. | 765 // Use less CPU for GC, at the expense of memory. |
753 GC_free_space_divisor = 1; | 766 sane_putenv ("GC_FREE_SPACE_DIVISOR", "1", false); |
754 } | 767 } |
755 #endif | 768 #endif |
756 | 769 |
757 void | 770 void |
758 setup_guile_env () | 771 setup_guile_env () |
759 /* | 772 /* |
760 * Set up environment variables relevant to Scheme | 773 * Set up environment variables relevant to Scheme |
761 */ | 774 */ |
762 { | 775 { |
763 #if (GUILEV2) | 776 #if (GUILEV2) |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
802 setup_paths (argv[0]); | 815 setup_paths (argv[0]); |
803 setup_guile_env (); // set up environment variables to pass into Guile API | 816 setup_guile_env (); // set up environment variables to pass into Guile API |
804 /* | 817 /* |
805 * Start up Guile API using main_with_guile as a callback. | 818 * Start up Guile API using main_with_guile as a callback. |
806 */ | 819 */ |
807 scm_boot_guile (argc, argv, main_with_guile, 0); | 820 scm_boot_guile (argc, argv, main_with_guile, 0); |
808 | 821 |
809 /* Only reachable if GUILE exits. That is an error. */ | 822 /* Only reachable if GUILE exits. That is an error. */ |
810 return 1; | 823 return 1; |
811 } | 824 } |
OLD | NEW |