markw65 / monkeyc-optimizer

Utilities for optimizing monkeyc projects
8 stars 0 forks source link

optimize dictionary.get, put, array.put #5

Open flocsy opened 6 months ago

flocsy commented 6 months ago

IMHO you could optimize quiet a lot by replacing dictionary.get(x) with dictionary[x] and dictionary.put(x, y) with dictionary[x] = y (both save -9 bytes, -8 after bytecode optimization). And similarily array.put(x, y) can be replaced with array[x] = y with similar gains.