Code eficiency
in
Programming Questions
•
9 months ago
Hi,
i am working on this data visualization project, and its like 40% done. Well, i suddenly realized about my code being not so efficient since functions are called from functions and similar trails.
- void setup() {
- ......
- ....
- .....
- schedule = new Table("asdf.tsv");
- setupMain();
- }
- void setupMain() {
- NumberOfRows = lines.length;
- .....
- ...........
- FlightNumber = new String[NumberOfRows]; //initializing arrays
- Origin = new String[NumberOfRows];
- Destination = new String[NumberOfRows];
- Frequency = new String[NumberOfRows];
- DepartureTime = new String[NumberOfRows];
- ArrivalTime = new String[NumberOfRows];
- placeIndices = new HashMap();
- ..........
- ..........
- setupTime(DepartureTime); // Separate Functions
- setupOrigin(Origin);
- setupDestination(Destination);
- setupFrequency(Frequency);
- } <--- End of setupMain()
- setupTime(String[] DepartureTime) {
- ....
- ....
- }
- void draw() {
- ...
- }
1