Skip to content

Instantly share code, notes, and snippets.

@gustavopinto
Last active August 29, 2015 14:01
Show Gist options
  • Save gustavopinto/c9da0e2ab1566674f172 to your computer and use it in GitHub Desktop.
Save gustavopinto/c9da0e2ab1566674f172 to your computer and use it in GitHub Desktop.
Open Data

Open data for the energy commit study

We welcome anyone who is interested in replicate our study

Steps:

  • Get commits on githubarchive.org
  • Automatic filter
  • Manual filter

Get commits on githubarchive.org

Follow the instructions descibred at githubarchive.org on how to create an account on Google BigQuery, and run the following query.

SELECT repository_url, payload_commit_id, payload_commit_msg, created_at 
FROM [githubarchive:github.timeline]
WHERE payload_commit_msg is not null
and payload_commit_msg like "%energy consum%" 
or payload_commit_msg like "%energy efficien%" 
or payload_commit_msg like "%energy sav%" 
or payload_commit_msg like "%save energy%" 
group by repository_url, payload_commit_id, payload_commit_msg, created_at 
order by created_at asc

At the end, export the resuts as a csv file. Rename this file to energy_commits.csv. In this step, we found 263 commits.

Automatic filter

Create the filter.py file, insert the following code inside the file, and run as python filter.py energy.csv. It will create two files: energy_commits.csv and energy_commits404.csv.

import sys
import requests

def read(file):
    f = open(file, "r")
    lines = f.readlines()
    f.close()
    return lines
    
def write(file, content):
    with open(file, 'w') as myFile:
        myFile.write(content)
    
def http_status(commit):
    r = requests.get(commit)
    return r.status_code

if len(sys.argv) < 2:
    sys.stderr.write('Usage: filter.py file.csv\n')
    sys.exit(1)

lines = read(sys.argv[1])

del lines[0]

commits = set()
commits404 = set()

for line in lines:
    columns = line.split(",")
    commit = columns[0] + "/commit/" + columns[1]
    status = http_status(commit)
    if status == 200:
        commits.add(commit)
    elif status == 404:
        commits404.add(commit)
    else:
        print status, commit
    
write("energy_commits.txt", '\n'.join(commits))
write("energy_commits404.txt", '\n'.join(commits404))

After this filter, we removed 44 commits.

Manual filter

We then looked into each one of the remaining commits in order to verify if they are related to one approach to save energy through code modifications. After this process, we removed 113 commits.

Final list

This is the list of our group of commits.

SHA Message
1 b334c save energy across filter transformation
2 edb99 rcu: Add callback-free CPUs RCU callback execution can add significant OS jitter and also can degrade both scheduling latency and, in asymmetric multiprocessors, energy efficiency [...]
3 19187 x86: Initialize IA32_MSR_ENERGY_PERF_BIAS The lowest 4 bits of the MSR serves as a hint to the hardware to favor performance or energy saving. 0 means a hint preference for highest [...]
4 8d96e improved backoff to be more energy efficient by parking waiting threads until submitting of new tasks
5 5ee04 HID: uhid: introduce user-space I/O driver support for HID This adds a dummy driver that will support user-space I/O drivers for the HID subsystem. This allows to write transport-level [...]
6 e978c mutex: dynamically disable mutex spinning at high load. The Linux mutex code has a MUTEX_SPIN_ON_OWNER configuration option that was enabled by default in major distributions like Red Hat. [...]
7 e8e93 switching mosfets for the ENC28J60 for energy saving :D
9 98962 mutex: dynamically disable mutex spinning at high load. The Linux mutex code has a MUTEX_SPIN_ON_OWNER configuration option that was enabled by default [...]
10 bfd07 made it easier? there is no longer a requirement to be in your main network if you are both connected to the same network it will still mount your backup disk. Since the IP is now dynamically taken [...]
11 84741 * Changed TXPOWER configuration to only accept values between CC2520_TXPOWER_MIN and CC2520_TXPOWER_MAX (0-8) to ensure only recommended tx power values are used in the radio. Any other value might [...]
12 22bda HID: uhid: Fix sending events with invalid data This was detected because events with invalid types were arriving to userspace. The code before this patch would only work for the first event in the queue [...]
13 128c3 moved to objects almost everywhere, added energy saving features
14 e9771 Moved Linux 64-bit directory to /bin/linux-x86_64 from the main /bin directory. Disabled debugging output. Small energy saving fix, fix for drawing message text and prevention against accidental closing of the game after the victory is attained.
15 612bb added better energy saving (+- 100 uA)
16 5b988 energy saving added, scan start, stop responsiveness added
17 05c8f tmux: Don't update status line every second Changed to 60 second for energy saving, especially on Mavericks
18 a0f94 back to energy efficiency with simple synchronization without spins
19 d86d0 Added energy consumption to conveyorbelt, jumppad, levitationpad, pump, and reformatted some of the code
20 9c185 Added references to datasheet pdf in order to explain the code in certain cases
21 61b84 wip: arduino energy saving
22 e3725 mutex: restrict mutex spinning to only one task per mutex. The current mutex spinning code allow multiple tasks to spin on a single mutex concurrently. There are two major problems with this approach [...]
23 a2cd2 Made network save energy on split
24 33802 Merge pull request #83 from senseobservationsystems/pref3GenergySaving Pref3 genergy saving
25 b4fb5 Add support for Energy Micro RTC scheduling clock instead of standard SysTick. This allows energy savings - using SysTick won't allow very deep sleep.
26 43a15 Send device to sleepmode to save energy.
27 03965 ucmini: remove unnecessary IO pin settings (and save energy)
28 c2c09 Multiple energy efficiency optimizations
29 9e149 save energy buffer fixes #65
30 c561c Updated to be more energy efficient.
31 22f86 implemented energy efficient buffer manager. but need debug.
32 d66a3 several tweaks for energy saving
33 eaa58 energy saving in loop
34 3cf95 Enable recorder to blank screen (to save energy).
35 45bc0 Replaced the custom implementation that utilizes a 100ms Thread sleep with a java.concurrent implementation relying on blocking. Reduced energy consumption for idle
36 f8281 Starting implementing a score board to help track player's score based on position and to decrement energy usage based on the score boards traversal. Energy usage is consumed more by obstacles which contain a energy consumption multiplier.
37 9cb18 rcu: Reduce cache-miss initialization latencies for large systems [...]
38 32cc1 tools/power turbostat: v3.0: monitor Watts and Temperature Show power in Watts and temperature in Celsius when hardware support is present. Intel's Sandy Bridge and Ivy Bridge processor generations [...]
39 c2ba3 event: add timer accuracy/coalescing logic In order to improve energy consumption we should minimize our wake-ups when handling timers. Hence, for each timer take an accuracy value and schedule [...]
40 bd396 try not energy efficient back off
41 858ab Actually pause renderer on pauserenderer energy savings
42 56a7c adding piggyback functionality for stats (also available for crazy heuristics for energy consumption)
43 74765 Mod: start service from boot up Mod: handle weather query exception Mod: use energy efficient location query
44 713a1 Fixed energy consumption when opening from stealth. [...]
45 39ad2 Tweak console output, change scaling for energy consumption
46 0a630 Added automatic energy saving for lights (LED), by checking if no motion is detected every 3 seconds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment