CSC/ECE 517 Fall 2014/oss M1455 asa: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
Line 28: Line 28:
   ./mach build<br>
   ./mach build<br>


[[File:Build_servo.png|200px|thumb|left]<br>
[[File:Build_servo.png|200px|thumb|left]
<br>
<br>



Revision as of 01:26, 29 October 2014

EVALUATE REPLACING C IMAGE & FONT LIBRARIES WITH RUST EQUIVALENTS

In this wiki we represent the steps followed in order to implement the taskes assigned under the the above OSS Mozilla Project. It required us to make changes to the Servo code base.

Introduction

Servo is an experimental web browser layout engine being developed by Mozilla Research for new generation hardware. The project has a symbiotic relationship with the Rust programming language, in which it is being developed. Rust is a new programming language for developing reliable and efficient systems.

Servo currently depends on a lot of C libraries, because Rust equivalents did not exist when the project started. We want to evaluate switching some of these to new Rust libraries that have been created. This project involves rewriting the code that uses these libraries as well as taking measurements before and after to determine the costs involved.

Aim

The aim of our project is display the time required by the decode function to decode images of different formats, e.g, jpeg, bmp, png, gif.

Steps of Implementation

We implemented the following steps on our linux machine:

• Build Servo

1. We first need to clone the servo repository using the following command:
git clone https://www.github.com/servo/servo

Now we have a local copy of the servo codebase.

2. We build the servo using

  ./mach build

[[File:Build_servo.png|200px|thumb|left]

3. Once our servo is built, we can run it using a test url

  ./mach run url 





• Add timing code

1. In image_cache_task.rs , we have a fn decode which calls the load_from_memory fn in base.rs.
2. Image decoding is implemented in this load_from_memory function.
3. So we added the timing code arround this function call in imacge_cache_task.rs
4. precise_time_ns() gives us the current time.
5. So we added it before the call to get the start time of decoding and after the call to get the end time.
6. Difference of the two gave us the decoding time, which can be printed on command line.

let start_time=precise_time_ns();
 let image = load_from_memory(data.as_slice());
 let end_time=precise_time_ns();
 let required_time=(end_time-start_time) as f64/1000000f64;



• Rebuild Servo

== Run Tests ==

We tested images with different file formats and resolution using ./mach run image_url.

These are the results we got: