-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't parse command line arguments each time `Options()` is called. The metaclass syntax was changed in Python 3 (see [1]) and it is tricky to add a metaclass in a Python version agnostic way. Still possible, but the code would be hard to understand. So I get rid of the Singleton metaclass and use __new__() to implement this logic. Aside of the Option class, we had another singleton: Colorer. However it is instanciated once (this instance is exposed as color_stdout) and it does not matter, whether it is a singleton or not. A brief testing on tarantool's test suite (with --long --force) gives me ~8 minutes after the fix instead of ~11 minutes before the fix. However it worth to note that we have a lot of tests, which are marked as fragile and so run without parallelization. Otherwise the difference would be lower, I guess. [1]: https://www.python.org/dev/peps/pep-3115/ Fixes #279
- Loading branch information
1 parent
83867b7
commit 1263cb5
Showing
3 changed files
with
18 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.